I have created two stored procedure from a single table:
Database name : sampleDemo
USE sampleDemo
GO
ALTER PROCEDURE employeeList
@city VARCHAR(50)
AS
BEGIN
SELECT
emp_id, emp_dob
FROM
employee
WHERE
emp_city = @city
ORDER BY
emp_id
END;
This one working completely fine but the other one:
USE sampleDemo
GO
ALTER PROCEDURE sp_listofemp
@city VARCHAR(50)
AS
BEGIN
SELECT emp_id, emp_name, emp_city, emp_dob
FROM employee
WHERE emp_city = @city
ORDER BY emp_id
END;
Though both the procedure are almost same still the second one is throwing error
Msg 208, Level 16, State 6, Procedure sp_listofemp, Line 2 [Batch Start Line 2]
Invalid object name 'sp_listofemp'
Can someone help me where I am doing wrong?