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 |
|
Looper
Yak Posting Veteran
68 Posts |
Posted - 2010-04-23 : 09:49:58
|
| I am trying to use the following query but I get the following error when running "System.Data.SqlClient.SqlException: None of the result expressions in a CASE specification can be NULL"StatusId is an FK,int field that allows nulls. CASE [StatusId]WHEN 0 THEN NULLENDI am using this query in a Insert Into.... Select From query - the above is in the Select part. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 09:51:48
|
| no need of case. just use NULLIF([StatusId],0)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Looper
Yak Posting Veteran
68 Posts |
Posted - 2010-04-23 : 09:55:50
|
Of coursethanks. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 09:56:35
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|