Say I have a basic stored procedure like so:create procedure sp_GetParts(@Date1 DateTime, @MODEL varchar(50)) asSELECT PartNo, SerialNo, MfgDateFROM dbo.PartsWHERE (MfgDate=@Date1) AND (PartNo=@MODEL)
I have several basic procedures like this stored on our SQL 2000 Server now, and they return all of these parts.What management has asked is that they allow us to give them a list of SerialNo values that fit this category to further narrow the resulting dataset.The problem is: There could be any number of SerialNo values!How could I modify my Stored Procedure so that they could take a List parameter?create procedure sp_GetPartsFiltered(@Date1 DateTime, @MODEL varchar(50), "List" @SnList varchar(20)) asSELECT PartNo, SerialNo, MfgDateFROM dbo.PartsWHERE (MfgDate=@Date1) AND (PartNo=@MODEL) AND SerialNo IN @SnList
I know the code above does not work, but hopefully this will get my point across.
Avoid Sears Home Improvement