I am attempting to alter an existing stored procedure with the command
ALTER \'name_of_stored\"procedure\'
however the name is highlighted in red noting it i
I had the same problem and saw an incredible number of possible answers, some quite exotic. Unfortunately I didn't see this page before finding what worked for me. I thought I would add this even though I believe it serves the same end as refreshing Intellisense. I knew I had done my work right because the stored procedure worked correctly in spite of the error so I finally decided it was not a 'real' error.
I exited SSMS and re-entered and the Invalid Object Name error no longer appeared. I presume that refreshed the Intellisense as well.
Intellisense doesn't refresh as quickly as you create new objects. You need to refresh the cache (Ctrl + Shift + R). Or, maybe, don't rely on Intellisense and only worry if the execution fails.
In my case on SQL Server 2014 Express, the stored procedure name value showing this error message
Invalid object name "SP_NAME"
even if the stored procedure has already been created and executing successfully. But after enable IntelliSense, error was removed and every stored procedure query working fine.
Create a stored procedure by using CREATE PROCEDURE
, not ALTER PROCEDURE
.
I had the same issue, the problem was that I had a select statement from stored proc who's name was similar to table's name, so instead of
select * from Table_Test
I was writing this in the stored procedure
select * from Proc_Test --selecting from Stored proc, yikes!!
maybe this helps
It's SSMS, not SQL Server. If it's an error against the database engine you'll know it (it wouldn't execute the command successfully).
You need to refresh the Intellisense cache (Ctrl + Shift + R). Or you can go to Edit -> IntelliSense -> Refresh Local Cache.