Viewing 3 posts - 1 through 3 (of 3 total)
When you use "IF NOT EXISTS", you should also check and ensure the table exists. E.g., this demo code:
IF NOT EXISTS(
SELECT * FROM sys.columns
WHERE object_ID=object_id('HumanResources.Employee')
AND col_name(object_ID,column_Id)='BusinessEntityID'
)
BEGIN
--it doesn’t exist so do...
October 4, 2023 at 10:34 am
October 2, 2010 at 10:25 am
You guys are all genius!
Thanks. Your solution both works like a charm.:-D
June 10, 2010 at 6:56 am
Viewing 3 posts - 1 through 3 (of 3 total)