Skip to main content

Posts

Showing posts from 2014

Pass Delimited List to SQL Server Stored Procedure

thank you albao This Stored Procedure shows how to accept a comma delimited list of ID’s and return records from a table that match the items of the delimited list: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 -- ============================================= -- Description: Returns one or more user records from the Users table. -- This sproc allows clients to have to make only one call to retrieve more than one record from a table (as opposed to calling the sproc for each record). -- The parameter is a varchar that can be a comma delimited list of UserId's. ---- For example: A parameter of '1,8,9,45' will return four users of which have a UserId ---- of 1, 8, 9, or 45 -- ============================================= ALTER PROCEDURE