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
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 TO FIND SQL DELTA DATA

Author  Topic 

Sandeep S
Starting Member

1 Post

Posted - 2014-03-28 : 00:35:37
Hi Friends,

Is there any way to find out the DELTA DATA between 2 tables which are residing on separate.Can anyone please help me on this?
This is the scenerio ,i had 2 tables Source and Destination.

In this source table Some rows the column values are different,i Need to Capture this Changed data or the difference between these 2 tables and want to put this on a 3rd table

Certain Condition are there,

1) No tool is allowed.
2) I had already tried the MERGE statement but it couldn't give me the solution i wanted.
3) Suppose some data in destination table are Old one ie, I had recently updated some rows in Source,Inserted some rows and deleted some rows also.I need to know the status in the new table whether its been deleted,updated or inserted .
4) And in the source table i had recently altered the table and added a new column,so the newly created table must have this column also.
5) It should be ok for all tables in the specified databases and the specified servers,ie Source database and destination database need not be in the same server.

6) I had one more doubt is there that From TRANSACTION LOG is it possible to get this information,if yes how? i already use the function fn_dblog(NULL,NULL) and DBCC by this i saw the data but its stored in hexa decimal format so i didnt understand how or what is happend in the table,Is it posible to obtain the solution through transaction Log read.if it how i can decode it?

Sample Source Table Data and Schema
-------------------------------------------------UserID UserName Dept Address
1 Liya Development Delhi

2 Jith Business Kochi

3 Vyshnavi HR Pune

4 Raj Admin Noida

5 Ravi Sr.DBA Kerala

Sample Destination Table Data and Schema
-------------------------------------------------

UserName Dept Address[/u][/b]
1 Liya Development RaiPur

2 Jithin Business Kochi

3 Vyshnavi DBA Pune

4 Raj Admin Noida



I just want the difference in data between the source and destination into a new table.In these 2 tables the source data and destination data are diffrent so i want that diffrence to be inserted into a new table is that possible?
   

- Advertisement -