I have sql server 2008.
I have two databases: "DB1" and "DB2".
In "DB1" there is a store procedure that has to select values
and insert them to table in "DB2".
I can I do it?
I can I connect to one database from another database?
How can I insert values to table from store procedure in another database SQL server
Started by rivkic, Jul 21 2010 12:34 AM
2 replies to this topic
#1
Posted 21 July 2010 - 12:34 AM
|
|
|
#2
Posted 21 July 2010 - 04:37 AM
It depends on the security settings, but yes it's possible. I recently did a database migration where I connected to one database and executed:
INSERT INTO TABLE1 (values) SELECT values FROM DB2.dbo.TABLE2;
Of course, the values was a little complicated :)
INSERT INTO TABLE1 (values) SELECT values FROM DB2.dbo.TABLE2;
Of course, the values was a little complicated :)
#3
Posted 21 July 2010 - 10:55 PM
thank you so much!:thumbup:


Sign In
Create Account


Back to top









