--Data DictionarySELECT ( Case whenA.colorder=1 ThenD.nameElse "' End) Table name, A.colorder field ordinal, a.name field name, ( Case when ColumnProperty(A.id,a.name,'isidentity')=1 Then '√'Else "' End) identification, ( Case when(SELECT Count(*) fromsysobjectsWHERE(Nameinch (SELECTname fromsysindexesWHERE(ID=a.ID) and(indidinch (SELECTindid fromSysindexkeysWHERE(ID=a.ID) and(colidinch (SELECTcolid fromsyscolumnsWHERE(ID=a.ID) and(Name=(A.name)))))) and(Xtype= 'PK'))>0 Then '√' Else "' End) primary key, B.name type, A.length takes up the number of bytes,ColumnProperty(A.id,a.name,'PRECISION') aslength,IsNull(ColumnProperty(A.id,a.name,' Scale'),0) asNumber of decimal digits, ( Case whenA.isnullable=1 Then '√'Else "' End) allows null,IsNull(E.text,"') default value,IsNull(g.[value],"') asField Description fromSyscolumns A Left Joinsystypes b onA.xtype=B.xusertypeInner Joinsysobjects D ona.ID=D.id andD.xtype='U' andD.name<>'dtproperties' Left Joinsyscomments e onA.cdefault=e.id Left Joinsys.extended_properties G ona.ID=g.major_id andA.colid=g.major_idOrder byA.id,a.colorder, table name
SQL Server Export Data dictionary