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.
Stored Procedures and Functions A procedure or function is a schema object that logically groups a set of SQL and other PL/SQL programming language statements together to perform a specific task. Procedures and functions are created in a user's schema and stored in a database for continued use.
Procedures are schema-bound. If a schema name isn't specified when the procedure is created, the default schema of the user who is creating the procedure is automatically assigned.
Here is an example of how to call a stored procedure inside another stored procedure. This is also known as nested stored procedures in SQL Server. Step 1: Create two simple stored procedure to insert some data into two different tables. both accept four parameters to insert the data.
Try this
EXEC SP_HELPTEXT 'SCHEMA.SPROC'
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With