Error When Running Stored Procedure
Im sorry if this is trivial, but I am still learning the ropes and apologise.
I have a stored procedure which contains the following script:-
IF @OUID=0 OR @RelatedOUID=0
PRINT 'UNABLE TO FIND OUID'
-- get next record using the cursor
FETCH NEXT FROM CursorToProcessRecords INTO
IF @OUID>0 AND @RelatedOUID>0
IF @DEBUG=1 PRINT @OUID
I am testing the stored procedure with only 3 accounts where I know there are no values for @OUID and @RelatedOUID, the stored procedure does not print the 'UNABLE TO FIND OUID' but instead try's to process the record (Insert) thus causing errors when Inserting rather than moving on to the next record.
Any insight would be greatly appreciated.