all groups > sql server dts > september 2007 >
You're in the

sql server dts

group:

Best practices w.r.t. use of Stored Procs in SSIS


Best practices w.r.t. use of Stored Procs in SSIS B NO[at]SPAM ns
9/13/2007 5:08:04 AM
sql server dts:
Hi,

I need to know whether it is good to use a Stored Procedure in the Execute
SQL Task inside a SSIS package or whether the functionality of the SP should
be emulated using the SSIS tasks and transformations.

We have some DTS packages which are calling a Stored Procedure to do all the
transformations, INSERTs, DELETEs and UPDATEs.

Should we go ahead and do the same thing in SSIS (we are migrating to SQL
Server 2005) or emulate the behavior of the Stored Procedure using the SSIS
Tasks and Transformations?

Thanks in advance.

RE: Best practices w.r.t. use of Stored Procs in SSIS Todd C
9/13/2007 6:00:03 AM
Hello B@ns:
You might as well have asked "What kind of computer should I buy?"
Answer: It depends on what you will be doing with it.

The answer to your question kind of depends on what exactly you are doing in
the SP.

If it is a simple "INSERT INTO <Table 1> ... SELECT ... FROM <Table 2> then
I would probably stick with a stored procedure.

But if you are pulling from one Database/server to another, PLUS converting
data, PLUS have a lot of *IF* statements to control the flow of the SP, then
I would go with SSIS.

I have seen a simple SP beat an SSIS package by a magnitude of 10 times
faster. But you can't possible manage some of the Control Flow complexities
in a stored procedure. Nor do you get the rich Configuration options, Error
handling, logging, etc.

Can you give us a taste of exactly what is going on the your SP?

--
Todd C

[quoted text, click to view]
Re: Best practices w.r.t. use of Stored Procs in SSIS Jeffrey Williams
9/13/2007 7:56:38 PM
[quoted text, click to view]
One thing to note in SSIS - if your stored procedure uses temp tables to
extract the data from the source system you will have problems.

Re: Best practices w.r.t. use of Stored Procs in SSIS Wael (Will) Fadel
9/13/2007 9:19:50 PM
Yes. Also, don't forget the PIPELINE and the non-blocking transfomtions that
you can use in the pipeline.

Some of the packages I converted from DTS to SSIS have had their execution
time cut in half since I was performing most of my updates using Variables
and pushing the values into the derived column transformation.

The pipeline allows you to reduce the amount of IO hits and speeds things up
a bit.

Will



[quoted text, click to view]

RE: Best practices w.r.t. use of Stored Procs in SSIS B NO[at]SPAM ns
9/13/2007 10:30:00 PM
Hi Todd,

Thank you for your reply.

I have 2 kinds of SPs:

1) Does a bulk insert into the "Load" tables in SQL Server 2005. Then
inserts this data into the master tables using Joins. Here we Insert new
records, Delete obsolete records and Update existing records.

2) The second type uses Cursors to browse through the recordset and sends
mails based on some conditions.

Regards,
B@ns


[quoted text, click to view]
Re: Best practices w.r.t. use of Stored Procs in SSIS B NO[at]SPAM ns
9/13/2007 10:42:00 PM
Hi Jeff,

Thank you for the reply.

One of my SPs is indeed using a temp table to extract data.
It will be great if you could also state the problems associated with this.
Does this mean that I should leave the SP as is or should I try to emulate
this functionality in the SSIS package?

Regards,
B@ns.


[quoted text, click to view]
AddThis Social Bookmark Button