SELECT so.name ,
sc.name ,
st.name ,
sc.length ,
CASE
WHEN sc.status = 0x80
THEN 'Y'
ELSE 'N'
END AS IsIdent ,
ColOrder
FROM sysobjects so
INNER JOIN syscolumns sc
ON so.id= sc.id
INNER JOIN systypes st
ON sc.xtype = st.xusertype
WHERE so.Name = 'YourTableName'
ORDER BY ColOrder
I used this for generating a Bulk Insert statement for a XML Rowset in C#.
No comments:
Post a Comment