Stored procedure and two databases

  • Thread starter Thread starter PhatCat
  • Start date Start date
P

PhatCat

I need to create stored procedure that transfers data from one database to
another. I don't know how to make two connections in the same time - can I
do it in stored procedure or can stored procedure take connections as
arguments? I'm working in C# and writing procedure in SQL Server.
Thanks a lot
 
If both are SQL Server, link the servers (add a linked server to the server
with the stored procedure) and write a query that moves the data inside that
sproc.

If one is not SQL Server, you can set up a DTS package and fire it from
DTSRUN.exe in a Process object (or from a sproc, if you must).


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top