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
 syncronize tables

Author  Topic 

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2006-11-29 : 22:28:43
i have 4 databases:

DA
DB
DC
DD


Database D has three instances:

IA
IB
IC

I would like to syncronise information to move from instances in DD to the appropriate other databse
e.g:

IA => DA
IB => DB
IC => DC

is this possible using code or features in sql server 2005?

thank you

Kristen
Test

22859 Posts

Posted - 2006-11-30 : 01:41:55
INSERT INTO DA.dbo.MyTable
SELECT *
FROM IA.DD.dbo.MyTable

??

or am I misunderstanding something?

(IA will have to be set up as a linked server. The same thing can be accomplished (better probably) using DTS - or whatever its now called in 2005)

Kristen
Go to Top of Page

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2006-11-30 : 01:46:35
does that move all or only those not in table b
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-30 : 02:23:43
I've no idea what "table b" is!
Go to Top of Page

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2006-11-30 : 06:59:21
ah okay does this make sense to anyone else?
Go to Top of Page

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2006-12-03 : 17:40:13
anyone?

i really need help with this? my other option is to purchase sql compare software however id rather code it
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-12-03 : 18:01:14
quote:
Originally posted by rnbguy

anyone?

i really need help with this? my other option is to purchase sql compare software however id rather code it



Did you say that YOU'D rather code it, or we?
C'mon, the specs are such that 50% of the requirements we have to guess.

And No, a:
insert someTableA(<something>)
select <somthing> from someTableB

Does in fact NOT take any consideration to the possibility that the row might already exists in the other table, right...

So you will have some constraints in the other instance's database to make sure that you get an ERROR if someone tries to do this, ok...

Or, you can CODE it with some sql using keywords like EXISTS...


rockmoose
Go to Top of Page
   

- Advertisement -