In the query window, you can open the Stored procedure in another query window?

Is there a command inside the query window that will open the stored procedure in another query window?

i.e. MODIFY dbo.pCreateGarnishmentForEmployee

I am using SQL Server Management Studio 2005 and Red SQL SQL Prompt.

Currently, I have to follow these steps:

Open Object Explorer Programming Navigation | Stored Procedure Right-click the name of the stored procedure. Select Modify.

The query window opens using the ALTER procedure.

As I mentioned above, what I would like to do is the type of request window in something influenced

EDIT dbo.pCreateGarnishmentForEmployee

+4
source share
3 answers

Here you are trying to use two technologies.

  • SQL and SQLSyntax
  • SQL Management Tool

It is probably not possible to use TSQL to manage Studio Management, as you see fit. I suspect cut and paste is your only option.

+2
source

I think the only way I know about this leads to a result similar to what you ask for, sp_helptext works against the name of the stored procedure

sp_helptext 'dbo.pCreateGarnishmentForEmployee' 

which will display the text as a result set. Then click on the column heading and copy / paste the results into the query window. You will also need to change

 CREATE PROCEDURE ... 

to

 ALTER PROCEDURE ... 

This method does not always create a beautifully designed layout for your stored procedure, so keep that in mind.

+1
source

There is a way to do this from the command line (i.e. due to SSMS).

This requires that you save the text of the stored procedure (as in, click "save" and not execute). Here is an example:

 Ssms "C:\...\SQL Server Management Studio Projects\mySolution\myProject\myScript.sql" 

For more information, see the article on MSDN: http://msdn.microsoft.com/en-us/library/ms162825.aspx

+1
source

All Articles