Hello,
I want to check if column exists or not in SQL Server table and need to add a specific column if it does not exist.
I create a code as follows, but it always returns false:
So, how can I check if a column exists in a table in SQL Server database?
I want to check if column exists or not in SQL Server table and need to add a specific column if it does not exist.
I create a code as follows, but it always returns false:
Code:
IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'myTableName' AND COLUMN_NAME = 'myColumnName')
Comment