473,545 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 20 '05 #1
2 4662
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

sa*********@hot mail.com (Samir Pandey) wrote in message news:<33******* *************** ****@posting.go ogle.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

Jul 20 '05 #2
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....

Pr************@ hotmail.com (Mystery Man) wrote in message news:<87******* *************** ****@posting.go ogle.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

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
22102
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my application server can talk to the database. I've determined the failure occurs when the the following statement is executed: cstmt.execute(); (due...
4
6096
by: Mike | last post by:
Hello, I'm currently working on debugging a very large DTS package that was created by someone else for the purpose of importing data into my company's database. The data is mainly user/contact-related data for our customer base. We ran into problems when one import, of about 40,000 rows, took upwards of six hours to complete. Many of...
5
5143
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value 'D11' to :workdept and I have checked in the table that 6 rows should have returned. Any ideas why no resultset is being returned. import java.sql.*;...
7
3199
by: JIM.H. | last post by:
Hello, Is there any difference to between SLQ string in the code and call execute query and call a stored procedure and execute the query that way concerning speed, effectiveness, reliability, …? Thanks, Jim.
7
3242
by: Jerry | last post by:
I'm trying to execute a stored procedure in a loop while paging through database table records but the stored procedure isn't running. I get the folowing error: The component 'adodb.connection' cannot be created. Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive. Can anyone tell me...
0
2872
by: jabernet | last post by:
As importing/exporting data ist not directly supported for JDBC/SQLJ, we call a c-stored procedure which uses the administrative API for exporting/importing. Now with the newest DB2 8.1 Fixpack (#13), we get an error "SQL3525N CODEPAGE option is incompatible with the LOBSINFILE option during IMPORT". Using the workaround described under...
3
15767
by: mandible | last post by:
I'm trying to call one stored procedure inside another. I was wondering if this is possible Some ideas I was toying with is putting the first stored procedure inside of a temp table but haven't been able to get this idea to work.
3
6861
by: comp_databases_ms-sqlserver | last post by:
This post is related to SQL server 2000 and SQL Server 2005 all editions. Many of my stored procedures create temporary tables in the code. I want to find a way to find the query plan for these procs Repro --*********************************** use pubs go CREATE PROCEDURE Test @percentage int
0
2296
by: Geethu03 | last post by:
Hi I had a doubt in Mysql Stored procedure. i need to read a text file (that is stored in mysql database) using the Stored procedure. i know little bit about the Stored procedure but i am not able to read a file. import java.sql.*; import java.io.*; import java.lang.*; import java.util.StringTokenizer; public class test { ...
0
7405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7659
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7428
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7760
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5975
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
709
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.