IF EXISTS (SELECT 1 FROM SYSOBJECTS WHERE name = 'tba')
BEGIN
DROP TABLE tba
END
GO
CREATE TABLE tba
(
col1 INT,
col2 iNT
)
GO
IF EXISTS (SELECT 1 FROM SYSOBJECTS WHERE name = 'tbb')
BEGIN
DROP TABLE tbb
END
GO
CREATE TABLE tbb
(
col3 INT,
col4 INT
)
GO
SELECT name FROM SYS.Columns
WHERE OBJECT_NAME(object_id) IN ('tba','tbb')
name
col1
col2
col3
col4
------解决方案--------------------
------解决方案--------------------
------解决方案-------------------- 如果你的数据表名字为a,那么: select a.name from syscolumns as a inner join sysobjects as b on a.id=b.id and b.name='a'