[thelist] SQL Server & Stored Procedures

spinhead evolt at spinhead.com
Mon Oct 29 19:40:29 CST 2001


(fuzzy off-the-top-of-my-head answer) You should be able to check @@ROWCOUNT

If @@ROWCOUNT <> 0 Then
    do the deed

spinhead


----- Original Message ----- 
From: "Beau Hartshorne" <beau at cubeinc.ca>
To: "thelist" <thelist at lists.evolt.org>
Sent: Monday, October 29, 2001 5:22 PM
Subject: [thelist] SQL Server & Stored Procedures


> Hi,
> 
> I have a stored procedure that looks something like this:
> 
> DELETE FROM NEWS_COMMENTS_DEV WHERE comment_id = @comment_id
> UPDATE NEWS_ARTICLES_DEV SET a_comments = a_comments - 1 WHERE news_id =
> @news_id 
> 
> I would like to execute the UPDATE statement only if the DELETE command
> managed to delete something. So what's the best way to do this?
> 
> Thanks,
> 
> Beau
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 





More information about the thelist mailing list