Unix Technical Forum

DTS/Async Stored procedure/Import huge data

This is a discussion on DTS/Async Stored procedure/Import huge data within the SQL Server forums, part of the Microsoft SQL Server category; --> I have a table which contains approx 3,00,000 records. I need to import this data into another table by ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:25 PM
Samir Pandey
 
Posts: n/a
Default DTS/Async Stored procedure/Import huge data

I have a table which contains approx 3,00,000 records. I need to
import this data into another table by executing a stored procedure.
This stored procedure accepts the values from the table as params. My
current solution is reading the table in cursor and executing the
stored procedure. This takes tooooooo long. approx 5-6 hrs. I need to
make it better.

Can anyone help ?

Samir
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:25 PM
Mystery Man
 
Posts: n/a
Default Re: DTS/Async Stored procedure/Import huge data

Cursors are evil!!!!

However, to be able to fully answer your question, we need to see your
stored proc/schema or even the results of a showplan.


I have used DTS/stored procs to import all sorts of data and have
never once had to resort to cursors (maybe I have just been lucky).
Generally speaking, I normally just do a select statement from the
source table which is used as input to the destination and doing any
casting/coercion along the way.

eg

create proc finky as

insert into
source
(a
,b
,c
)
select
a as char(2)
,IsNull(b, '')
,c
from
destination





samirpandey@hotmail.com (Samir Pandey) wrote in message news:<33d418fa.0308071922.5061c0a4@posting.google. com>...
> I have a table which contains approx 3,00,000 records. I need to
> import this data into another table by executing a stored procedure.
> This stored procedure accepts the values from the table as params. My
> current solution is reading the table in cursor and executing the
> stored procedure. This takes tooooooo long. approx 5-6 hrs. I need to
> make it better.
>
> Can anyone help ?
>
> Samir

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 05:25 PM
Samir Pandey
 
Posts: n/a
Default Re: DTS/Async Stored procedure/Import huge data

Hey thanks for your help. but....i just can't simply insert data in
the destination table. I need to run the values thru a logic which
exists in stored procedure.(e.g. if existing price is less than the
new price, then update another field which means that the price has
reduced/increased on a particular day)... and some other i make in the
stored procedure.

Thats why i need to run the values thru a stored procedure.

now can you help...?
thanks alot....



PromisedOyster@hotmail.com (Mystery Man) wrote in message news:<87c81238.0308080439.79404088@posting.google. com>...
> Cursors are evil!!!!
>
> However, to be able to fully answer your question, we need to see your
> stored proc/schema or even the results of a showplan.
>
>
> I have used DTS/stored procs to import all sorts of data and have
> never once had to resort to cursors (maybe I have just been lucky).
> Generally speaking, I normally just do a select statement from the
> source table which is used as input to the destination and doing any
> casting/coercion along the way.
>
> eg
>
> create proc finky as
>
> insert into
> source
> (a
> ,b
> ,c
> )
> select
> a as char(2)
> ,IsNull(b, '')
> ,c
> from
> destination

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com