SELECTTable name= Case whenA.colorder=1 ThenD.nameElse "' End, Field ordinal=A.colorder, PRIMARY key= Case when exists(SELECT 1 fromsysobjectswhereXtype='PK' andNameinch ( SELECTName fromsysindexesWHEREIndidinch( SELECTIndid fromSysindexkeysWHEREId=a.ID andColid=a.colid ))) Then '√' Else "' End, field name=a.name, type=b.name, Length=ColumnProperty(A.id,a.name,'PRECISION'), number of decimal digits=IsNull(ColumnProperty(A.id,a.name,' Scale'),0), allow null= Case whenA.isnullable=1 Then '√'Else "' End, field Description=IsNull(g.[value],"') 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.minor_id Left JoinSys.extended_properties F onD.id=f.major_id andf.minor_id=0 whereD.name not like '%dict%' --If you query only the specified table, add this conditionOrder byA.id,a.colorder