June 6, 2012 at 2:15 am
hi
i need script or function or procedure to get field's name has data difference and get this data
which the tables have same fields
Example:
tableA
code name sector
1 Jone 1
tableB
code name sector
1 Jone 3
gave me
field is sector
data tableA's filed 1
data tableB's filed 3
June 6, 2012 at 2:20 am
can you have multiple people called Jone in your tables? if so is the code the same in tableA and tableB for the right name?
SELECT
A.Code,
A.Name,
A.Sector,
B.Sector
FROM
tableA A
INNER JOIN
tableB B
ON
A.Code = B.Code
AND
A.Name = B.Name
WHERE
A.Sector <> B.Sector
June 6, 2012 at 5:14 am
thanks for help me
i need to know this field only but
this table contain more from one field
Example1:
tableA
code name sector department
1 Jone 1 10
tableB
code name sector department
1 Jone 1 30
get field department only
Example2:
tableA
code name sector department
1 Jone 1 10
tableB
code name sector department
1 Jone 3 40
get fields sector and department only
June 6, 2012 at 5:56 am
hello Dear,
you can use AppexSQLLog for Compare data in 2 table and find difference beteen.
Best Regards,
zohreh
June 6, 2012 at 6:16 am
thanks zohreh
but i will use this script in my project (exe)
June 6, 2012 at 7:02 am
SQL Server has a TABLEDIFF.exe that you may use to compare objects, check BOL for more info
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply