Split strings (SQL Server 2008)

Using the Split String function in SQL Query

 SELECT Item
 FROM dbo.'plitString('string1,'string,....')

or you can use split string function in stored procedure. Here I am writing a sample of string function in stored procedure.

CREATE PROCEDURE GetEmployees
      @EmployeeIds VARCHAR(100)
AS
BEGIN
      SELECT FirstName, LastName
      FROM Employees
      WHERE EmployeeId IN(
            SELECT CAST(Item AS INTEGER)
            FROM dbo.SplitString(@EmployeeIds, ',')
      )
END