1If you are querying SQL Server -, change the sys.extended_properties to Sysproperties2 3 SELECT 4Table name= Case whenA.colorder=1 ThenD.nameELSE "' END,5Table description= Case whenA.colorder=1 Then ISNULL(F.value,"')ELSE "' END,6Column ordinal=A.colorder,7Column Name=A.name,8Identity= Case when ColumnProperty(A.id,a.name,'isidentity')=1 Then '√'ELSE "' END,9Main keys= Case when EXISTS(SELECT 1 fromSYSOBJECTSWHEREXTYPE='PK' andParent_obj=a.ID andNAMEinch (Ten SELECTNAME fromsysindexesWHEREIndidinch( One SELECTIndid fromSysindexkeysWHEREId=a.ID andCOLID=A.colid))) Then '√' ELSE "' END, AType=B.name, -Number of bytes=A.length, -Length= ColumnProperty(A.id,a.name,'PRECISION'), theNumber of decimal digits= ISNULL(ColumnProperty(A.id,a.name,' Scale'),0), -Allow empty= Case whenA.isnullable=1 Then '√'ELSE "' END, -Default value= ISNULL(E.TEXT,"'), -Field description= ISNULL(G.[VALUE],"') + from - syscolumns A + Left JOIN A systypes B at on -A.xusertype=B.xusertype - INNER JOIN - SYSOBJECTS D - on -a.ID=D.id andD.xtype='U' andD.name<>'dtproperties' in Left JOIN - syscomments E to on +A.cdefault=e.id - Left JOIN the sys.extended_properties G * on $a.ID=g.major_id andA.colid=g.minor_idPanax Notoginseng Left JOIN - sys.extended_properties F the on +D.id=f.major_id andf.minor_id=0 A ORDER by theA.id,a.colorder
Query sql2005&2008 all table information