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 |
|
fpendino
Starting Member
5 Posts |
Posted - 2010-05-27 : 13:25:06
|
| Hi, I'm trying to using a formatted array with an IN() function for a where criteria.Here's what the array would look like.DECLARE @QueueArray varchar(300)SELECT @QueueArray = QueuesFROM @tmpQueRemoveProcessWHERE ROW = @Counter--@QueueArray data could be like ('501', '501R')-- Here's how I use the array.UPDATE tblQueuesSET IncentiveEmpPID = 'na', ProductivityEmpPID = 'na'WHERE Queue IN(@QueueArray)Shouldn't this work the way I have this setup for using that "string array"?Thanks,Frank |
|
|
fpendino
Starting Member
5 Posts |
Posted - 2010-05-27 : 13:36:39
|
| Ok, I think I found the answer to my question. I guess I need to use a table-valued paramter, which I'm familiar with, but why if I pass this varchar string that is formatted with a single quote around the value and a comma to separate, won't this work? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-27 : 13:45:55
|
quote: Originally posted by fpendino Ok, I think I found the answer to my question. I guess I need to use a table-valued paramter, which I'm familiar with, but why if I pass this varchar string that is formatted with a single quote around the value and a comma to separate, won't this work?
Becuase all values seperated by delimiter will be treated as a single valueMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|