Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS duplicating data? 1

Status
Not open for further replies.

deepsheep

Programmer
Sep 13, 2002
154
CA
I am exporting from SQL server to excel through a VB 6 data Transformation that was outputted by DTS. I've modified the automatically generated package to allow me to specify the date range to extract for and the file name to extract to.

In my sql table there are no duplicated rows, but when I export through my program, all the data is in the excel file twice. So, every row in my table is in my excel file two times. When I run just the SQL query I'm using through query analyzer, I have no duplicates. That leaves me with Excel or the DTS package causing the problem.

I'd appreaciate any ideas!

Thanks



 
Not sure if this is the answer but I seem to remember having a similar problem exporting to excel and am sure it was down to the dts appending to the excel file rather than creating it each time the DTS is run.

So if you run the DTS again you will have three occurences of each row of data from your SQL Server table.

I remember not being able to find a solution other than changing the Excel destination to a text file destination and saving it as a CSV which can be opened in Excel.


[bandito] [blue]DBomrrsm[/blue] [bandito]
 
I think you are on to something. When I re-ran the script today with a new file name, I didn't have any duplicates in my excel file. When this is in production, it will have a unique file name for every time it is run based on the date which should help. The only thing that confuses me is that when I run the script with an existing file, it fails, so I'm not sure how it could export twice to a file.

Thanks for your guidance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top