Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure

Status
Not open for further replies.

steveot

IS-IT--Management
Joined
Oct 27, 2003
Messages
1,635
Location
US
Newbie to SQL

I have a database that has a "stored procedure"

I would like to copy this stored procedure to a remote SQL server on another site that is running the identical database.

I know I can right click on the stored procedure and copy to notepad, etc

Is there someway I import this with OSQL
 
Take the code from notepad and put it into Query Analyzer and run the code. This will create the stored procedure.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
MrDenny,

I think he wants to run a script that finds the stored procedure and copies it over to the remote server without him doing anything else.

Steve,

I don't think SQL Server has anything like that built-in. You probably could write a script that finds the procedure and sends it to the remote server (is it a linked server?). But you would still have to the CREATE PROCEDURE on the other server to apply the copied procedure. So, it's still going to take manual intervention and will probably just be easier to do the whole thing manually.

This why I've learned to keep all my procedures in one folder on my system. I can just copy that folder over to a new location.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top