Showing posts with label srv02. Show all posts
Showing posts with label srv02. Show all posts

Wednesday, March 28, 2012

How to insert data into table

can some one help me, how can i insert data, using some commands,

scenario,

two server, srv01 and srv02, both have database sales and both a table saleshistory

pseudocode:

insert into srv02.sales.dbo.saleshistory select * from srv01.sales.dbo.saleshistory where id > srv02.sales.dbo.saleshistory.max(id)

In other words, you want to get all records from srv01 that are not on srv02, and insert them into srv02. Correct?

This will help you: http://www.sqlis.com/default.aspx?311

-Jamie

|||

i want to push data from srv01 to srv02, and your example is for same server with two tables, its ok , i have written a small ssis package and its really cooool...

any ways thanks Jamie... :)

|||

The location of the tables for the example is utterly irrelevant. The technique still works.

As long as you've got a solution anyway, that's the important thing!

-Jamie