I need to add a specific column if it does not exist.
(如果它不存在,我需要添加一个特定的列。)
I have something like the following, but it always returns false: (我有类似以下内容,但始终返回false:)
IF EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'myTableName'
AND COLUMN_NAME = 'myColumnName')
How can I check if a column exists in a table of the SQL Server database?
(如何检查SQL Server数据库表中是否存在列?)
ask by Maciej translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…