C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

How to copy the stored procedures from one database to another database through query?


Posted Date: 23 Nov 2008      Posted By: sivakumar      Member Level: Silver     Points: 1   Responses: 1



Hi

How to copy the stored procedures from one database to another database through query?


Regards,

Siva





Responses

Author: Gaurav Arora    23 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 6

Hi Sivakumar,
Whenever you want a stored-proc in a table you need to create the proc.

If you really want to copy or want the same proc in your another table. You can do the same as :

1. First of all Open Query Analyzer
2. Get the entire definition of existing proc like:
sp_helptext <procname>
3. Change the database [it doesn't matter you use (use <dbname>) or dropdown dbname list]
4. Run the query analyzer by pressing Ctrl+E or F5
5. The existing proc will be added in your selected table.

Before performing above task(s) please remember following(s):

1. The schema will be the same of targetted table
2. If not 1 then modify the proc as per your new table
3. You can also do the all above by generating Script from Query analyzer.


Best of luck!

Thanks & regards,
Gaurav Arora



Thanks & regards,
Gaurav Arora - Sr. Editor
Me in My Own Style



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : alter table in cursor
Previous : HOW TO TRANSFER DATA WHICH IS DELETED FROM ONE TABLE TO FRESH TABLE WHICH IS CREATED
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use