Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Pass comma separated (delimited) values as Parameter to Stored Procedure in SQL Server without creating function

$
0
0

Hi,

I have to write a stored procedure and where i have to pass value in comm separated values in IN CLAUSE.

this i want without creating function.

REATE PROCEDURE GetEmployees
@EmployeeIds VARCHAR(100)
AS
BEGIN
SELECT FirstName, LastName
FROM Employees
WHERE EmployeeId IN(@EmployeeIds)

END

EXEC GetEmployees'1,3,5,9'

Thanks,
Satyam


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>