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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-08-08 : 07:40:35
|
Nachi writes "I'm calling a stored procedure based on some condition and passing some variables to the stored procedure.One of the variable will have a value something like this"EMP_JOIN_DATE in ('date1','date2','date3')"Using this varaible in stored procdures I have to write a query something likeselect @record_count=count(*) from emp whereemp_join_date in (all the dates from that variable)I tried using replace method and removed the sting EMP_JOIN_DATE in but it works for one values not for multiple dates.is there any way I can pass all the dates in to this query?" |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-08 : 13:09:21
|
You need to double the single quotes.Also why do you want to pass condition as parameter?Read this fullyhttp://www.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|