Generating CREATE PROCEDURE Scripts on Existing Stored Procedures in SQL Server
How To Generate CREATE PROCEDURE Script on an Existing Stored Procedure in SQL Server Transact-SQL?
If you want to know how an existing stored procedure was created, you can use SQL Server Management Studio to automatically generate a "CREATE PROCEDURE" script The following tutorial shows you how to do this:
1. Run SQL Server Management Studio and connect to SQL server.
2. On the Object Explorer window, follow the object tree: Databases > FyiCenterData > Programmability > Stored Procedures > dbo.ShowFaq.
3. Click right mouse button on dbo.ShowFaq. The context menu shows up.
4. Select "Script Stored Procedure as" > "CREATE to" > "New Query Editor Window". The following script will be displayed:
USE [FyiCenterData] GO /****** Object: StoredProcedure [dbo].[ShowFaq] Script Date: 05/19/2007 21:31:35 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[ShowFaq] AS BEGIN PRINT 'Number of questions:'; SELECT COUNT(*) FROM Faq; PRINT 'First 5 questions:' SELECT TOP 5 * FROM Faq; END; CREATE TABLE Faq (Question VARCHAR(80));
2017-01-05, 1480👍, 0💬
How To Get the Definition of a User Defined Function Back in SQL Server Transact-SQL? If you want ge...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
How to create new tables with "CREATE TABLE" statements in SQL Server? If you want to create a new t...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...