如何检查一个列是否存在于Sql Server 2008的表中?

这个问题在这里已经有了答案:

  • 如何检查SQL Server表中是否存在列? 23个答案

  • 尝试这个:

    SELECT t.name as TabName
        ,c.name as ColName
    FROM sys.columns c 
    INNER JOIN sys.tables t on c.object_id = t.object_id
    WHERE c.name like '%COLUMN_NAME%'
        AND t.name = 'TABLE_NAME'
    
    链接地址: http://www.djcxy.com/p/94403.html

    上一篇: How to check if a column exists in a table in Sql Server 2008?

    下一篇: How to improve performance for datetime filtering in SQL Server?