DECLARE @Table_Name NVARCHAR(100)
SET @Table_Name = 'mytablename'
SELECT object_name(c.id) AS table_name,
c.name AS column_name,
t.name AS data_type
FROM syscolumns AS c
INNER JOIN systypes AS t ON c.xtype = t.xtype
WHERE c.id = object_id( @Table_Name )
* How to find out column data types of a table in SQL Server
No comments:
Post a Comment