SELECT sys.objects.name AS 表名,sys.columns.name AS 列名,sys.types.name AS 数据类型 FROM sys.objects JOIN sys.columns ON sys.objects.object_id=sys.columns.object_id JOIN sys.types ON sys.columns.user_type_id=sys.types.user_type_id WHERE sys.objects.type='U' ORDER BY sys.objects.name,sys.columns.column_id
转换数据类型用CAST(数据 AS 新类型) 或 CONVERT(新类型,数据)
转自qq_32915337的博客:http://blog.csdn.net/qq_32915337/article/details/73740765