December 5, 2011 at 2:46 pm
i want to be able to write a script that compares data that has been added to a database and not in the data warehouse, does anybody care to show me an example
December 5, 2011 at 3:00 pm
Read up on not exists, or except.
Select * FROM dbName.owner.tblname
Come back with a more specific question when you have it.
December 5, 2011 at 3:44 pm
Also, check out the MERGE statement syntax: http://technet.microsoft.com/en-us/library/bb510625.aspx
December 6, 2011 at 9:56 am
can you do it with like an outer join to get the latest added data
December 6, 2011 at 9:57 am
Of course you can. What exactly do you need to do and what are your limitations?
December 6, 2011 at 10:08 am
i wanna right a script instead of using an ssis package to track changes between the datawarehouse and my OLTP, do you have a script example that you can show me..just providing the technical details...any example will suffice. thanks so much
December 6, 2011 at 10:11 am
... depends on what you are transfering.
What type of data / documents are you downloading?
December 6, 2011 at 10:14 am
just name and addresses of individuals
December 6, 2011 at 10:17 am
What's the PK? Identity by any change (or anything ever increasing would be nice)?
December 6, 2011 at 10:20 am
The PK is and identity column thats all
December 6, 2011 at 10:22 am
DECLARE @Id INT
SET @Id = (SELECT TOP 1 ID FROM <local system>)
INSERT INTO <local system> (columns list)
SELECT Columns, list FROM ServerName.DbName.owner.tblname WHERE Id > @Id
This assumes those dbs are on different servers. If not, then remove the ServerName. part.
December 6, 2011 at 10:33 am
Ok thanks you have been great help
December 6, 2011 at 10:37 am
HTH, come back if you need more help or get stuck.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply