Link to home
Start Free TrialLog in
Avatar of romeiovasu
romeiovasu

asked on

sql 2005 query for pulling records

HI All,

i have Database A and Database B. i have tables in Database A When ever any record is inserted or updated it has to be updated in to tables which is Database B.

i cannot create triggers on Database A due to warranty issues. how can i pull the records from the table from database a to tables into database b.

can some one help me this is very urgent for me.
Avatar of MOA81
MOA81
Flag of Jordan image

Hi romeiovasu,

you didn't specify in details if the tables are the same, is it a sync job you are trying to pull:

you have the following options:

- replication

- create a job that will run every 10 minutes

again you didnt specify enough details

you might need to create Integration Services Project as well, it might be considered as an option
Assuming the tables are similar I'd suggest you create a unique identifier column in both tables and use it as a key and then link one server to the other. Then you will have to create job that will do all the updates.

Because Uniqueidentifier field is globally unique you can just copy data without worrying about duplicated keys. To make things more efficient you should mark records already synced and those that need to be copied or updated.

It would be easiest if the record has last updated timestamp column or you could create one.
If not depending on columns you could add computed column with a checksum and compare them.
Avatar of romeiovasu
romeiovasu

ASKER

no those are not same tables i have to just pull those records and add it to my staging database and push into my master tables.

Database B is going to my staging database.

i will give my real time.

we have Database A, Database B, Database C, Database D.

all databases above i cannot create triggers because of warranty issues.

and i have a staging database. where i have to pull the records from the above database when ever any records are inserted or updated. and add the company id those records and send it to staging database.

Then u need to write ur own Logic To solve the Issue.
Yes, you have to implement your own logic but you can still use jobs to execute it.
Try linking servers and creating stored procedures first, and then creating a scheduled job.
yes i have already linked and i got the logic too. but can some one provide me a sample script how to get those new records which has got inserted or updated.
ASKER CERTIFIED SOLUTION
Avatar of lof
lof
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial