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 2008 Forums
 Transact-SQL (2008)
 DIFF

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-02-22 : 05:55:59
Syntax for DIFF - what can it be used for?

I need to compare between imported tables, from Excel, - every value, in every column & row. Is that possible?

DaleTurley
Yak Posting Veteran

76 Posts

Posted - 2010-02-22 : 06:26:03
Look in Books Online.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-02-22 : 06:35:59
Never heard of any function named as "DIFF" but SQL server does have a function named as Difference which indicates a very close or exact match between 2 values.


PBUH
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-22 : 07:29:39
quote:
Originally posted by mikebird

Syntax for DIFF - what can it be used for?

I need to compare between imported tables, from Excel, - every value, in every column & row. Is that possible?


Why do you want to do this?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-02-22 : 08:20:05
Load massive tables from different sources - different countries - check data integrity!!! All has to be exactly the same! Isn't this the DBA no.1 task to execute before anything else?

Different set of columns / rows... we got a problem!

How do you do it?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-22 : 08:44:28
I would write a query to display and differences - what I would term an "exception report" - "Exception" because it shows things that should NOT be there - so a normal report is an empty report
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-22 : 08:52:19
quote:
Originally posted by mikebird

Load massive tables from different sources - different countries - check data integrity!!! All has to be exactly the same! Isn't this the DBA no.1 task to execute before anything else?

Different set of columns / rows... we got a problem!

How do you do it?


you can do it using table difference component in ssis.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -