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 |
|
derketo
Starting Member
28 Posts |
Posted - 2005-01-10 : 22:14:55
|
| Is there ANY way to use an IN clase inside a stored procedure without using dynamic SQL? The query I have to run is huge (the below is just a very small slice) and I need the performance boost. LIKE clause won't work...too many similarities between fields.Thanks in advance.CREATE PROC [dbo].[spTestABC]@ParmUsername nvarchar(32)ASselect Usernamefrom Memberswhere Username IN (@ParmUsername)GO |
|
|
derketo
Starting Member
28 Posts |
Posted - 2005-01-10 : 23:32:04
|
| Forget it...using CSV. |
 |
|
|
jbkayne
Posting Yak Master
100 Posts |
Posted - 2005-01-10 : 23:32:31
|
| Two ideas:Use a User Defined Function to create a 1xN row table based on the input paramter which I assume is a comma delimited string.Otherwise, pass in an XML document and create a table using OPENXML.Good luck! |
 |
|
|
DustinMichaels
Constraint Violating Yak Guru
464 Posts |
|
|
|
|
|