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 |
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-11-03 : 13:19:35
|
| @SelectFields is really a string of product names for ex. 'name1','name2','name3'. Is this the right way to write this query.CREATE PROCEDURE dbo.getInfo@id int = 0,@SelectFields nvarchar(MAX)ASSELECT * from table1where (id=@id) and name in (@SelectFields)SA |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-11-03 : 13:25:22
|
| Nope, not the "in (@selectfields) parts Search this site for Parsing techniques "Parse Values"JimEveryday I learn something that somebody else already knew |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-04 : 02:03:22
|
| http://www.sommarskog.se/arrays-in-sql-2005.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|