I have a function in my .NET application, for which an unknown number of parameters are required to be searched.
For example: Select is it possible to do this . SQL? How do I go about making dynamic parameters in .NET (I was thinking of doing this with a loop) but how do I declare them in my stored procedure? Please please > You can enter a separate list, split a table function into a table and then use one of these clauses. It goes on doing so. The table function: then come The cookie stored procedure can: from tbl where x = 1 or x = 2 or x = 3 or x = 4
create the list as dbo.funcListToTableInt (@ varchar (8000), @listim varchar (10)) as the @listTable Returns table (Value INT) - DELEIM DECLARE @DelimPosition INT - Help Assistant to identify the position of the loop, loop with initial check for Delim SET - DELEIMPosition = CHARINDEX (@Dilim, @list) - Through the loop, we can not get the delimiter @delimation & gt; 0 BEGIN - Add items to the table in the list INSERT @listTable (value) Price (CAST (RTRIM (left (@list, @delipship - 1)) as INT - Remove entry from list SET @ list = true ( @ List, lane (@list) - @ dayly position) - Post position comparison SET @DelimPosition = CHARINDEX (@Delim, @list) End - If there is still an entry, add it to the list IF len (@list) & Gt; 0listTable Enter values (CAST (RTRIM (@list) as INT)) Go back end
SELECT * tbl in the WHERE id (SELECT value from funcListToTableInt (@ID, ','))
Comments
Post a Comment