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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Comparing files

Author  Topic 

Crespo

85 Posts

Posted - 2002-11-05 : 04:57:26
Salute,

O.K, maybe this is the wrong place for my question but I will try it here anyway.
A colleague of mine wanted to know if it is possible to compare TWO csv files in SQL server and return the difference. A bit like the diff command in UNIX.

Does anybody have any ideas on this?

Sorry, but I would have done more research but I have mountains of work to do and I really don't have time to experiment or read on this.

Thanks in advance.


Best Regards.

Crespo.
Hewitt Bacon & Woodrow
Epsom
Surrey
United Kingdom

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-11-05 : 06:07:34
There are a bunch of diff tools around for windows, perhaps look for a COM based tool that you could call.

Just a thought..

I've been thinking about diff tools for a project I am working on at the moment too but haven't had a chance to look too closely yet.



Damian
Go to Top of Page

Crespo

85 Posts

Posted - 2002-11-05 : 06:16:18
Hmmm.... interesting

I suggested that he transfers his .csv files to his unix area and use the diff command on them for now, but I am still interested to know if there is a tool in SQL server already. I would rather use that than call a COM tool to be honest.

Thanks for the ideas though!

Best Regards.

Crespo.
Hewitt Bacon & Woodrow
Epsom
Surrey
United Kingdom
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-11-05 : 06:20:06
Actually.....

There may be a way.
Load the CVSs into tables.
Then, write some queries to do some joins between the tables to find rows different in each one.

Damian

Edited by - Merkin on 11/05/2002 06:21:24
Go to Top of Page

Crespo

85 Posts

Posted - 2002-11-05 : 06:42:59
Heh... sounds like an easy enough idea actually. A UNION should do it me thinks!

Cheers for the advice.... By the way.. do you notice something!

I have a custom title now! LOL.... wooohooooo!

Best Regards.

Crespo.
Hewitt Bacon & Woodrow
Epsom
Surrey
United Kingdom
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-11-05 : 06:47:14
quote:

I have a custom title now! LOL.... wooohooooo!



Hate to ruin your day, but you don't. That title is automatic at 50 posts.

But keep trying....one day

Damian
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-11-05 : 06:57:16
quote:
A UNION should do it me thinks!


Should do what? Not anything discussed in this thread ...

Either a left outer join with an impossible conditional on the right side ... or a where not exists construct with a correlated subquery ... or if you felt like being slow about it, an in condition ...

However, to do a diff on OS file, you should probably use an OS level tool. No sense in square-peggin a round hole ...

Jay White
{0}

Edited by - Page47 on 11/05/2002 06:57:47
Go to Top of Page
   

- Advertisement -