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 |
|
LambrettaStarr
Starting Member
5 Posts |
Posted - 2004-05-06 : 15:47:56
|
| I am sure this has been answered before, but here is my question...In ASP I have a string that looks like this: 'value1', 'value2', 'value3'In my stored procedure I need to write a statement that will search a column against ALL of those values. When I hardcode parameters into the statement like below, it works and gives me what I want...declare @testRequirementsTable TABLE (testID varchar(50) NOT NULL) insert into @testRequirementsTable select distinct(testID) from tbl_TestRequirements where requirementType in ('valueA', 'valueB', 'valueC' ) select distinct(testID) from @testRequirementsTableso I create a dynamic table, then select the results I want from that table.Problem is that when I pass in my formatted string from ASP as a parameter, the SQL statement returns nothing. Here's how I've been doing that, with the variables being declared or created as parameters at the top of the stored procedure...:declare @testRequirementsTable TABLE (testID varchar(50) NOT NULL) insert into @testRequirementsTable select distinct(testID) from tbl_TestRequirements where requirementType in (@RequirementsList) select distinct(testID) from @testRequirementsTableAny ideas on how to accomplish this?The string I am trying to pass in is actually a result set from a query in another stored procedure. I originally wanted to do both queries from one procedure and return the end results of the statement shown here. Is that possible? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-05-06 : 16:03:28
|
| http://www.sqlteam.com/item.asp?ItemID=11499Tara |
 |
|
|
|
|
|