DH
Programmer
- Dec 8, 2000
- 168
Hello,
Need help passing in the following string of fileID numbers to use in the stored procedure shown below. I would like the stored proc to return information for all users with the following fileID numbers (these fileID numbers are dynamically generated so I need to pass in on the fly)
10, 11, 15, 22, 30
I eventually will pass in the parameter using asp.net / vb.net but for now, I am testing using query analyzer like so:
The is doesn't work because SQL interprets that I am passing in too many parameters.
What is the correct syntax to use?
Thank you,
DH
Need help passing in the following string of fileID numbers to use in the stored procedure shown below. I would like the stored proc to return information for all users with the following fileID numbers (these fileID numbers are dynamically generated so I need to pass in on the fly)
10, 11, 15, 22, 30
Code:
CREATE PROCEDURE [dbo].[Read_Address_List]
@fileIDs varchar
AS
SELECT firstName, lastName, address, city, state, zip
FROM users
WHERE fileId IN (@fileIDs)
GO
I eventually will pass in the parameter using asp.net / vb.net but for now, I am testing using query analyzer like so:
Code:
exec Read_Address_List 10, 11, 15, 22, 30
The is doesn't work because SQL interprets that I am passing in too many parameters.
What is the correct syntax to use?
Thank you,
DH