SQL – Create and use a stored procedure with table as a parameter

Tuesday, April 29, 2014

Using SQL Server 2012 Assuming we have a sample "TestDB" with the following scheme: Create a type which will use for the input parameter: Create a new stored procedure Fill in the stored procedure name, the parameter name and the query Notice the CostumersIDs is the parameter name and CostumersIdsType is it's type which we created earlier. For simplicity, the query I used just returns the received input parameter. Test the stored procedure in sql server: What happened here is: - We created a temporary table of our declared type (CostumersIdsType), and inserted into it a few value. - Called our stored procedure with the temporary table as a...
tags: , ,
no comments