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 |
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2007-02-06 : 01:15:36
|
| hi,how to pass message to front endselect count(*) from emp where empno=1if(count=0) i want to pass "no records" to front end(vb.net)if(count=1) "records found"is it possible to do this in sqlserver,if means please help me to do |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-02-06 : 01:26:01
|
| [code]SELECT CASE WHEN COUNT(*) = 0 THEN 'no records' ELSE 'records found' ENDfrom emp where empno=1[/code]Kristen |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-06 : 02:01:52
|
| if exists (select null from emp where empno = 1)select 'record(s) found'elseselect 'no records found'Peter LarssonHelsingborg, Sweden |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2007-02-06 : 02:24:39
|
| hi peso and Kristen thank you very much for reply |
 |
|
|
|
|
|