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 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2010-03-05 : 12:56:00
|
| hi,i try to write a procedurereate procedure commandata(@slot varchar(15),@location varchar(15),@frequency varchar(15))as select desckey,descvalue,desccategory from mst_desc where desccategory in(''@slot'',''@location'',''@frequency'') order by desckeyi got the errorIncorrect syntax near '@slot'.i think problem near ''@slot''Desikankannan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-05 : 12:58:32
|
| you dont quotes at allthis is enoughselect desckey,descvalue,desccategory from mst_desc where desccategory in(@slot,@location,@frequency) order by desckey------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2010-03-05 : 12:58:53
|
| Pretty sure you need 3" ' " s'''@slot'''Viskah may be right, but from his previous posts I thought he had built this one dynamically. Sorry :) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-05 : 13:06:57
|
quote: Originally posted by DP978 Pretty sure you need 3" ' " s'''@slot'''Viskah may be right, but from his previous posts I thought he had built this one dynamically. Sorry :)
then you would require ''' before and after concatenation ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|