Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Raise Error

Status
Not open for further replies.

sujosh

Programmer
Nov 29, 2001
93
US
I have a very simple if condition. If the if condition fails I want to raise error. I keep getting "Incorrect syntax near the keyword Begin". Here is snippet of the code

If Not isnull (inserted.subs1," ")

BEGIN
RAISERROR ('Field SUBS1 Is Read Only. Updating this field will cause loss of integrity', 16, 1)
ROLLBACK TRANSACTION
END

Any help is appreciated
Thanks
 
if not exists (select * from inserted where subs1 is null)

======================================
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.
 
Thank you very much. Appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top