get number of rows affected by Bulk Insert

nj07869
nj07869 used Ask the Experts™
on
Hello,

I am using BULK INSERT to insert data from text files, using Visual Basic 6.0. Is there any way that I can know number of rows inserted by BULK INSERT command.

Thanks,

NJ
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Afterwards you can always use the recordset's count, on forehand this depends on the textfile:
1) Fixed recordlength
   Just take the filezise and divide by the recordlength
2) Variable length
   Count the number of vbCRLF's in the file or open the file and use the line input to count.

Nic;o)
Commented:
actually i know that @@rowcount gives you number of rows affected by last statement. I tried that a lot using ADO but didnt work.

Finally I got the answer from MSDN that its a Microsoft BUG !!! so you have to use :

{? = call StoredProcedure} and this 'StoredProcedure' returns value of @@rowcount

like 'RETURN @@ROWCOUNT

thanks for trying.

NJ
nj07869:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial