if exists sql code example
Example 1: sql drop table if exists
DROP TABLE IF EXISTS dbo.Customers
Example 2: if exists sql server
IF EXISTS (SELECT * FROM tblGLUserAccess WHERE GLUserName ='xxxxxxxx')
BEGIN
SELECT 1
END
ELSE
BEGIN
SELECT 2
END