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 |
sth_Weird
Starting Member
38 Posts |
Posted - 2012-03-29 : 03:02:17
|
hi,I am using this sql query in sqlserver 2005, but it doesn't work for me :/SELECT tErrorCodeReactions.*, tErrorCodeReaction2Device.ReactionPriority FROM tErrorCodeReactions INNER JOIN tErrorCodeReaction2Device ON (tErrorCodeReactions.ReactionID = tErrorCodeReaction2Device.ReactionID) AND (tErrorCodeReaction2Device.DeviceID = 149) ORDER BY CASE WHEN tErrorCodeReaction2Device.ReactionPriority >= 0 THEN tErrorCodeReaction2Device.ReactionPriority WHEN tErrorCodeReaction2Device.ReactionPriority < 0 THEN tErrorCodeReactions.ReactionValue the error that is shown is: "Incorrect syntax near the 'SET' keyword". but there is no set keyword in the query? What's wrong with the query?thxsth_Weird |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-29 : 03:30:09
|
try highlighting only this query and execute it in the Query Window KH[spoiler]Time is always against us[/spoiler] |
 |
|
sth_Weird
Starting Member
38 Posts |
Posted - 2012-03-29 : 05:51:02
|
I'm already using the query view to test it.But I found out now that I simply forgot the 'END' keyword.This is the first time I'm using the 'CASE' function and when I googled for examples those that I found were usually stored procedures and I thought the END keyword belonged to the the stored procedure declaration.Anyway thank you for you answer!sth_Weird |
 |
|
|
|
|