How can I construct a stored procedure that will allow me to pass for example an IDList so that I can write:. This question has been asked before and already has an answer.
c# - Passing List<> to SQL Stored Procedure - Stack Overflow
If those answers do not fully address your question, please ask a new question. T-SQL stored procedure that accepts multiple Id values. Write the individual IDs to table B, all with the same "key" a GUID perhaps.
Then, your query against table A would include. You might then delete the keys if you are finished with them.
Or, timestamp them and have a sql job do it later. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.
sql server - Passing an "in" list via stored procedure - Stack Overflow
Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.
Log In Sign Up. Join the Stack Overflow Community. Stack Overflow is a community of sql stored procedure passing list.
Join them; it only takes a minute: This question already has an answer here: T-SQL stored stryker stock market that accepts multiple Id values 6 answers. Which database are you using? Which language are you passing the list from? With SQL and above you can send an array from code directly. First create a custom type CREATE TYPE Array AS table Item varchar MAX Than the stored procedure.
Add " Array", SqlDbType. This is only applicable to Sql server You don't send a string, which could expose you to sql injection in some circumstances. Depending on your other app logic, you don't have to track or write the possibilities all at once.
c# - How to pass an array into a SQL Server stored procedure - Stack Overflow
ExecuteReader ; share improve this answer. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.