SQL Server2005中如何获取表中某几列的数据类型?

日期:2016-03-17 04:02:52 人气:1

SQL Server2005中如何获取表中某几列的数据类型?

select c.name as [col_name],t.name as [type_name] from sys.columns as c inner join sys.types as t on c.user_type_id = t.user_type_id where c.[object_id] = object_id('dbo.YourTable') and c.[name] = 'YourColName' 或者,直接用type_name函数,更简洁: SELE
    A+
热门评论