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 2005 Forums
 Transact-SQL (2005)
 Bulk insert

Author  Topic 

girisignin
Starting Member

11 Posts

Posted - 2010-03-02 : 00:31:44
I have 10 rows in my table1. i want to insert them into table B. but there is some error in the 9th row. now i want to insert 1 to 8 and 10th rows to be inserted. how would this happen. can any one help me please..

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-03-02 : 00:34:55
In Oracle the feature of BulkInsert and Exception handling is directly available. Unfortunately, it is not in SQL Server 2005.

To start with you need to insert individual row and do error handling in a loop.

Regard,
Bohra

Go to Top of Page

girisignin
Starting Member

11 Posts

Posted - 2010-03-02 : 00:43:37
for millions of record loops will not be good idea. thank you
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-03-02 : 00:52:44
quote:
Originally posted by girisignin

for millions of record loops will not be good idea. thank you



In that case you can split the records using the views and bulkinsert using views.

If any error comes for a particular block, you can loop it and do exception handling.

Even I want to know the experts opinion on this because i am expecting same requirement in near future..


Go to Top of Page
   

- Advertisement -