How to pull data from one database to another database by using sqlsqerver 2005
like ..Exporting data from one and importing to the another.
From stackoverflow
-
Take your pick.
- Linked Server/databases.
- SSIS
- Exporting data from one and importing to the another.
-
In addition to no-one's answers, if the DB's are both SQL Server
4) Select * into New_Table From Server.Database.Owner.Table
ck : This is no_one's answer number 1MrTelly : A little example goes a long way though, and vec doesn't state whether he's moving between servers.marc_s : +1 for giving a nice clean example -
Based on your comments I understand that both databases are on the same server You can simply do:
use YourDestinationDatabaseName; select * into dbo.yourNewTable from YourSourceDatabase.dbo.YourSourceTableand if you want to insert into table that already exists
use YourDestinationDatabaseName; insert into dbo.YourDestinationTable select * from YourSourceDatabase.dbo.YourSourceTableor more precisely:
use YourDestinationDatabaseName; insert into dbo.YourDestinationTable( col1, col2, etc...) select col1a, col2a, etc ... from YourSourceDatabase.dbo.YourSourceTable -
If you have VS 2005, I like this tool, because it generates t-sql: http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
0 comments:
Post a Comment