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 |
|
CrazyT
Yak Posting Veteran
73 Posts |
Posted - 2010-07-01 : 14:39:25
|
| the query below works fine in my dev box -- when i move it to another sql server it errors on the case statementany reason it would fail or is there something wrong with the statement SELECT ID, key = CASE WHEN key = 'Account' THEN '0' WHEN key = 'BusinessAccount' THEN '1' END, FROM #tempTbl |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-07-01 : 15:14:44
|
| Whats the error it returns? Did you create the temp table #tempTbl before running it? |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-07-01 : 17:05:36
|
| There's a comma after the END before the FROM. Unless there are columns you omitted, that shouldn't be there--Gail ShawSQL Server MVP |
 |
|
|
CrazyT
Yak Posting Veteran
73 Posts |
Posted - 2010-07-01 : 17:10:28
|
| temp table is created before running it.I omitted the other columns.The error it returned was a -4 i think |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-07-01 : 17:54:15
|
| That's not a SQL error. SQL errors are all > 0 and have text messages.--Gail ShawSQL Server MVP |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-07-02 : 02:57:30
|
quote: Originally posted by CrazyT temp table is created before running it.I omitted the other columns.The error it returned was a -4 i think
Can you post the full code you used?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|