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 |
|
paritosh
Starting Member
42 Posts |
Posted - 2012-02-20 : 00:52:06
|
| 1:-declare @id numeric(10)beginprint @id /* is this print any value what is the value of this */end2:-declare @id numeric(10)beginselect @id= id from table where name='aaaa' /* and table have not any name with name 'aaaa'*/print @id /*what will give this print and how to handle this with null handling*/endthanks in advance... |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2012-02-20 : 03:42:25
|
| You can't print the Null value.You can use Select cluase declare @id numeric(10)beginselect @id= id from table where name='aaaa' /* and table have not any name with name 'aaaa'*/Select @id /*what will give this print and how to handle this with null handling*/endor else you can try something like thisif(@id is null)print 'null'elseprint @id endSenthil Kumar C------------------------------------------------------MCITP - Database Administration SQL SERVER 2008MCTS - Database Development SQL SERVER 2008 |
 |
|
|
|
|
|