I am maintaining a classic ASP website that has a SQL Server 2005 backend. For a small piece of new functionality I wrote a stored procedure to do an insert. This is the o
Sometimes this can also happen when you have a stored procedure being called with parameters. For example, if you type something like:
set @runProc = 'dbo.StoredProcedure'
exec @runProc
This will work, However:
set @runProc = 'dbo.StoredProcedure ''foods'''
exec @runProc
This will throw the error "could not find stored procedure dbo.StoredProcedure 'foods'", however this can easily be overcome with parantheses like so:
set @runProc = 'exec dbo.StoredProcedure ''foods'''
exec (@runProc)