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)
 DTS - Transform Data Task

Author  Topic 

otto
Starting Member

21 Posts

Posted - 2005-06-08 : 18:49:51
I have a question about DTS's Transform Data Task.

I have two databases that I'm transferring data between and I'd like to add a Execute SQL Task that inserts how many records were transfered. I know when I run the package, the GUI shows the number of records. I'd like to grab that value and put it into my history table.

Any help would be appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-08 : 18:55:21
If you are transferring data between two databases, then do this instead of using DTS:

DECLARE @rc int

INSERT INTO Destination.dbo.Table1
SELECT ...
FROM Source.dbo.Table1

SELECT @rc = @@ROWCOUNT

INSERT INTO TransferTable(TableName, TransferCount)
SELECT 'Table1', @rc

Tara
Go to Top of Page

otto
Starting Member

21 Posts

Posted - 2005-06-08 : 19:00:44
The other database is DB2 and I have to transform the data, so I don't think I can use straight SQL to do it. Thanks for a quick reply.
Go to Top of Page
   

- Advertisement -