Raise error and don't execute else block if is the condition is true
I want to write sql script to update my table if some columns don't have
null value, if it have null value the update statements will not be
executed, my code here raise the error and execute the else block,
why?????
IF EXISTS(select 1 from Invoices where Trx_Date is null or Trx_no is null
or OperaKey is null)
RAISERROR('This script can not been executed because of null value/values
in this columns.',0,1)
ELSE -- else code
No comments:
Post a Comment