Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Performing multiple actions in Stored Procedure

Author  Topic 

sid81
Starting Member

1 Post

Posted - 2007-09-13 : 01:13:21
How can we determine in a stored procedure whether a select statement is returing some data rows or not and act accordingly to it in the same store procedure. i.e. do some other action if the data returned by the select is null. Is there any way??

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-09-13 : 01:51:54
have a look at COALESCE in books online. it will give you the first arg of N args that is not null.


elsasoft.org
Go to Top of Page

mohit_sme
Starting Member

13 Posts

Posted - 2007-09-13 : 15:39:37
There are many solutions to this, you can use IF Exists OR @@RowCount to check if your SQL statement is returning any row.


Thanks
Mohit Nayyar
http://mohitnayyar.blogspot.com
Go to Top of Page
   

- Advertisement -