Script to get a list of the columns in a table along with the data type, size of each of those columns

Posted by Niladri.Biswas under Sql Server category on | Points: 40 | Views : 731
[Table Name] =
,[Column Names] =
,[Data Type] =
,[Size] = sc.length
,[Is Identity] = Case When sc.status = 0x80
Then 1 else 0
,[Is Computed] = sc.iscomputed
,[Column Order] = sc.colorder
FROM SysObjects so
Join SysColumns sc On
Join SysTypes st On sc.xtype = st.xusertype
Where so.Name = 'Specify table name'
Order By sc.colorder

Comments or Responses

Login to post response