As I said, did you specify the condition after the if condition. You couldnt execute the if condition alone, you must specify the next step that after the if validation step
Thanks. If you put column name in ' ' , it will bring the value. If you put it into " ", then it will be looking for a column, but will bring the same error.
IF EXISTS( SELECT * FROM SYSCOLUMNS WHERE OBJECT_NAME(ID) = 'tblSummaryStatus' and name = '_010')
BEGIN
PRINT 'column exists'
END
ELSE
BEGIN
PRINT 'column doesn't exist'
END
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.