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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Transfer specified data from one server to another

Author  Topic 

Legend1673
Starting Member

6 Posts

Posted - 2008-04-10 : 20:25:34
New to sql scripting and am having a problem. I have two SQL servers:
1. Keeps track of all sales related activities.
2. I would like to use for backup and reporting of sales only.

I am wondering if there is a script that can be run to transfer only specific data from the first server to the second, and if so what is the setup and syntax.

I am looking to do something like:

insert into [database#2] [table]
* from [database#1] [table]
where database#1-table.result='Sale'

Please help...
Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-10 : 20:41:15
INSERT INTO DbName2.dbo.TableName(Column1, Column2)
SELECT Column1, Column2
FROM DbName1.dbo.TableName
WHERE Column1 = 'Sale'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -