Monday, 26 August 2013

Need help to execute sql scripts within stored procedure

Need help to execute sql scripts within stored procedure

Need help as how I can trap any errors related to executing a sql script
in a stored procedure.
select sopScript from M_SopInsert where soptype = @soptype and sopnumbe =
@sopnumbe and lnitmseq = @lnitmseq
If result_count > 0 //if result from above sql query is >0
exec sopScript //loop through the record set and execute sopscript for
every record.
Note: sopscript here contains scripts like "update customerMaster set
custname='abc' where custid=100"
Please do not get upset with this question as I am new to sql stored
procedures.

No comments:

Post a Comment