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 |
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2010-03-17 : 02:20:53
|
| How to change query using In clause by passing parameter havind id'sMy id's are string typedeclare @PKId varchar(255)set @PKId = "MA000001 , MA000002 , MA000003 , MA000004"I am passing @test parameter using ado.net/Enterprise library data access blockI wanted it to be executed likeselect * from MyTable where MyStringPKId in('MA000001' , 'MA000002' , 'MA000003' , 'MA000004')Kamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-17 : 02:25:33
|
| Please let us know if this thread helpful.http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm |
 |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2010-03-17 : 03:02:17
|
| My problem is that I have a string type as the keymy field will not have special character.It is just alphanumericKamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2010-03-17 : 05:14:24
|
it is a big articleKamran ShahidSr. Software Engineer(MCSD.Net,MCPD.net) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-03-17 : 05:55:54
|
| Read the first article link first then! There are choices to be made, vyaskn shows you what they are and I reckon that is a good article helping you to choose a suitable method.If you have a large database, need best performance, and best-of-bred techniques then you need to read, and understand, the articles on Erland Sommarskog's site. But if your application is small, in house, not mission critical you can skip that class! |
 |
|
|
|
|
|
|
|