How to check if a column exists in MSSQL

To check if a column exists in MSSQL you can use the following snippet.

Sample MSSQL

SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('Pricetable') AND name='Price'

Please Share us:
Please rate this snippet

One thought on “How to check if a column exists in MSSQL

Leave a Reply