BulkInsert: Record Count - 10-04-2004 , 01:25 PM
I am using DTS Bulk Insert task to load the data from flat files to
SQL Server tables. How can i get the no. of records that is inserted
from the Bulk Insert task? I can get the record count using count(*)
but i should be getting it from Bulk Insert task also.
The problem with Select count(*) is - it takes considerable time to
Sometimes - I can use EXEC sp_spaceused to get the record counts
faster than SELECT count(*) approach.
Any help here will be of great use!
Thanks in advance
Re: BulkInsert: Record Count - 10-04-2004 , 01:53 PM
Why should you be getting it from the Bulk Insert task?
declare @i int
set nocount on
BULK INSERT T FROM 'c:\File1.txt'
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
set @i = @@rowcount
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
"Karthik R" <dtsguy1 (AT) rediffmail (DOT) com> wrote