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 |
|
mkapoen
Starting Member
2 Posts |
Posted - 2005-06-23 : 18:28:23
|
| Hello there,I have this stored procedure that does not work. I read some articles but I could not find the solution.The error message is: Syntax error converting the nvarchar value 'Display description...' to a column of data type int.I think it has something to do with casting, I can't seem to get it fixed. Can someone please help me out? I place the code below...Thanks in advance, Michael************************************************************I call the procedure with: EXEC Conditions_GetConditions 1************************************************************CREATE PROCEDURE Conditions_GetConditions@SortOrder tinyint = NULLASSELECT con_Id, con_name, con_description, con_ct_ID, ct_nameFROM conditionsINNER JOIN Condition_Types ON Condition_Types.ct_ID = conditions.con_ct_IDORDER BY CASE WHEN @SortOrder = 1 THEN con_description WHEN @SortOrder = 2 THEN con_name WHEN @SortOrder = 3 THEN ct_name ELSE con_Id ENDRETURNGOx |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
mkapoen
Starting Member
2 Posts |
Posted - 2005-06-25 : 06:53:49
|
| Thanks,I've got it working.I forsee only one problem: I had to convert a integer to a nvarChar.Selecting an integer geives another result than selecting a nvarChar.for instance:1 111 22 323 113 23etc.x |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-27 : 01:32:44
|
| Post sample data and the query you usedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|