Reputation: 5442
I am using SQL Server 2008 R2, and I have created a schema Test
and in that schema, I created a stored procedure.
I wanted to run it in the text mode by issuing this query:
EXEC SP_HELPTEXT SCHEMA.SPROC
But while running the above query I get this error:
Incorrect syntax near '.'.
Can someone please help me here to resolve this issue.
Upvotes: 21
Views: 11723
Reputation: 41
sp_helptext
to display the result when sp's or any other tsql
binded scripts run without schema, for example:
sp_helptext <nameof sp>
but when you want to run it with schema name as initial then run it into single quotes
sp_helptext 'schma.<nameofsp>
Upvotes: 4