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.
Author |
Topic |
fralo
Posting Yak Master
161 Posts |
Posted - 2010-12-14 : 17:39:00
|
Hi all,In my stored procedure, I run a select count(*) statement and I wanna find out if it returned > 0 records.Am I supposed to use ROWCOUNT for this or something else?This is not working:select count(*) from table where...if @@rowcount > 0...Thanks for help. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
fralo
Posting Yak Master
161 Posts |
Posted - 2010-12-14 : 17:47:53
|
Hey, thanks a lot. That worked. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-20 : 09:25:44
|
You can effectively turn it toif exists(select * from table where .......)..MadhivananFailing to plan is Planning to fail |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|