I am using SQL Server 2008 R2.
I want to drop the column if it is already exists in the table else not throw any error.
Tried:
ALTER TABLE Emp
DROP COLUMN IF EXISTS Lname;
Error:
Incorrect syntax near the keyword 'IF'.
By searching I came to know that, this option is available from 2016.
What is the alternative in the SQL Server 2008 R2?