Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Xml Shredding
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
--Sql Server 2014 Express Edition --Batches are separated by 'go' select @@version as 'sql server version' declare @xml xml select @xml = '<extensionG> <Tables> <Table TName="__MigrationHistory" Schema="dbo" TextImageOnFileGroup="PRIMARY"> <Columns> <Column CName="MigrationId" DataType="nvarchar" DataTypeMaxLength="300" DataTypePrecision="0" DataTypeScale="0" IsIdentityColumn="0" IsColumnNullable="0" PrimaryKey="1" /> <Column CName="ContextKey" DataType="nvarchar" DataTypeMaxLength="600" DataTypePrecision="0" DataTypeScale="0" IsIdentityColumn="0" IsColumnNullable="0" PrimaryKey="1" /> <Column CName="Model" DataType="varbinary" DataTypeMaxLength="-1" DataTypePrecision="0" DataTypeScale="0" IsIdentityColumn="0" IsColumnNullable="0" PrimaryKey="0" /> <Column CName="ProductVersion" DataType="nvarchar" DataTypeMaxLength="64" DataTypePrecision="0" DataTypeScale="0" IsIdentityColumn="0" IsColumnNullable="0" PrimaryKey="0" /> </Columns> </Table> <Table TName="CoatingCost" Schema="dbo"> <Columns> <Column CName="CoatingCostId" DataType="int" DataTypeMaxLength="4" DataTypePrecision="10" DataTypeScale="0" IsIdentityColumn="1" IdentitySeedValue="1" IdentityIncrementValue="1" IsColumnNullable="0" PrimaryKey="1" /> <Column CName="CoatingId" DataType="int" DataTypeMaxLength="4" DataTypePrecision="10" DataTypeScale="0" IsIdentityColumn="0" IdentitySeedValue="1" IdentityIncrementValue="1" IsColumnNullable="0" PrimaryKey="0" /> <Column CName="LabId" DataType="int" DataTypeMaxLength="4" DataTypePrecision="10" DataTypeScale="0" IsIdentityColumn="0" IdentitySeedValue="1" IdentityIncrementValue="1" IsColumnNullable="1" PrimaryKey="0" /> <Column CName="Cost" DataType="money" DataTypeMaxLength="8" DataTypePrecision="19" DataTypeScale="4" IsIdentityColumn="0" IdentitySeedValue="1" IdentityIncrementValue="1" IsColumnNullable="0" PrimaryKey="0" /> <Column CName="Price" DataType="money" DataTypeMaxLength="8" DataTypePrecision="19" DataTypeScale="4" IsIdentityColumn="0" IdentitySeedValue="1" IdentityIncrementValue="1" IsColumnNullable="0" PrimaryKey="0" /> </Columns> </Table> <Table TName="ContactLens" Schema="dbo"> <Columns> <Column CName="ProductId" DataType="int" DataTypeMaxLength="4" DataTypePrecision="10" DataTypeScale="0" IsIdentityColumn="0" IsColumnNullable="0" PrimaryKey="0" /> </Columns> </Table> </Tables> </extensionG>' SELECT DBTables.Name.value('@TName', 'varchar(100)') AS TableName, DBTables.Name.value('@Schema', 'varchar(20)') AS SchemaName, DBTables.Name.value('@TextImageOnFileGroup', 'varchar(20)') AS TextImageFileGroup, Cols.C.value('@CName', 'varchar(100)') AS ColName, Cols.C.value('@DataType', 'varchar(20)') AS DataType, Cols.C.value('@DataTypeMaxLength', 'varchar(5)') AS DataTypeMaxLength, Cols.C.value('@DataTypePrecision', 'varchar(5)') AS DataTypePrecision, Cols.C.value('@DataTypeScale', 'varchar(5)') AS DataTypeScale, Cols.C.value('@IsIdentityColumn', 'varchar(1)') AS IsIdentityColumn, Cols.C.value('@IdentitySeedValue', 'varchar(5)') AS IdentitySeedValue, Cols.C.value('@IdentityIncrementValue', 'varchar(5)') AS IdentityIncrementValue, Cols.C.value('@IsColumnNullable', 'varchar(1)') AS IsColumnNullable, Cols.C.value('@PrimaryKey', 'varchar(1)') AS PrimaryKey FROM @xml.nodes('//Tables/Table') AS DBTables(Name) CROSS APPLY DBTables.Name.nodes('Columns/Column') AS Cols(C)
View schema
Execution time: 0 sec, rows selected: 12, rows affected: 0, absolute service time: 0,16 sec
edit mode
|
history
|
discussion
sql server version
1
Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86) Feb 20 2014 19:20:46 Copyright (c) Microsoft Corporation Express Edition on Windows NT 6.3 <X64> (Build 9600: ) (WOW64) (Hypervisor)
TableName
SchemaName
TextImageFileGroup
ColName
DataType
DataTypeMaxLength
DataTypePrecision
DataTypeScale
IsIdentityColumn
IdentitySeedValue
IdentityIncrementValue
IsColumnNullable
PrimaryKey
1
__MigrationHistory
dbo
PRIMARY
MigrationId
nvarchar
300
0
0
0
NULL
NULL
0
1
2
__MigrationHistory
dbo
PRIMARY
ContextKey
nvarchar
600
0
0
0
NULL
NULL
0
1
3
__MigrationHistory
dbo
PRIMARY
Model
varbinary
-1
0
0
0
NULL
NULL
0
0
4
__MigrationHistory
dbo
PRIMARY
ProductVersion
nvarchar
64
0
0
0
NULL
NULL
0
0
5
CoatingCost
dbo
NULL
CoatingCostId
int
4
10
0
1
1
1
0
1
6
CoatingCost
dbo
NULL
CoatingId
int
4
10
0
0
1
1
0
0
7
CoatingCost
dbo
NULL
LabId
int
4
10
0
0
1
1
1
0
8
CoatingCost
dbo
NULL
Cost
money
8
19
4
0
1
1
0
0
9
CoatingCost
dbo
NULL
Price
money
8
19
4
0
1
1
0
0
10
ContactLens
dbo
NULL
ProductId
int
4
10
0
0
NULL
NULL
0
0