Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bangingtunes
Starting Member
23 Posts |
Posted - 2003-02-05 : 17:04:07
|
| I need to migrate data from one database to another, both running on the same instance of SQL server.Is there any way i can write a stored procedure that will query data from one database and insert it into a different database?Thanks |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2003-02-05 : 17:38:14
|
yes - just use 3 part naming to qualify the target database e.g.use database Ainsert databaseB.dbo.table1 select * from dbo.table1 HTHJasper Smith |
 |
|
|
bangingtunes
Starting Member
23 Posts |
Posted - 2003-02-05 : 19:47:40
|
| Wow, how simple, thanks. |
 |
|
|
bangingtunes
Starting Member
23 Posts |
Posted - 2003-02-05 : 19:57:37
|
| Im getting an error 154, Use is not allowed in a stored procedure?Kristian |
 |
|
|
bangingtunes
Starting Member
23 Posts |
Posted - 2003-02-05 : 20:03:36
|
| No worries, i didnt need the use statement, i was just forgetting the .dboKristian |
 |
|
|
|
|
|