SELECT COUNT(*) FROM syscolumns A WHERE A.id=object_id('数据库名.dbo.表名')
大写的A代表的是什么啊?
@kdkler: 是别名,可以去掉
SELECT COUNT(*) FROM syscolumns WHERE id=object_id('数据库名.dbo.表名')
SqlConnection conn;
conn.GetSchema("COLUMNS", new string[] { null, null, "表名", null });
貌似要这样才行吧?
use 数据库
go
SELECT COUNT(*)
FROM syscolumns
WHERE id=object_id('表名')