Showing posts with label tasks. Show all posts
Showing posts with label tasks. Show all posts

Tuesday, March 27, 2012

Calling Stored proc in ActiveX script

Hi!
How do you call a store procedure in an ActiveX script? I have a stored procedure that I want to execute everytime my Data Driven Query tasks inserts a new record.
Thanks.Dim oConn
Dim oComm

Set oConn = CreateObject("ADODB.Connection")
Set oComm = CreateObject("ADODB.Command")

oConn.ConnectionString = sConnectionString
oConn.Open

oComm.CommandText = "myStoredProc"
oComm.CommandType = 4 ' adStoredProc
oComm.Parameters.Refresh
oComm.Parameters("myParam") = "This"
oComm.ActiveConnection = oConn

oComm.Execute

(alternatively)

Set oRS = oComm.Execute

Written from the top of my head. Your mileage may very. Check syntax carefully. Never run while carrying scissors by the handle. Always keep your barrel pointed downrange.

Regards,

hmscott|||thanks for the advice!

Sunday, March 11, 2012

Calling a custom web service from my package to perform heavy-duty tasks

As part of my SSIS package, a list of sites is created that need to be created on a remote machine. let's say 1000 sites. I need to pass this list to a web service so web service sitting on that machine creates these sites for me. MY SSIS package does not run frequently so I can sacrifice time a little bit to get better functionality.

I need to move the sites that are not created (for any reasons) by web service to another table and successfully created sites to another table, so I need to get confirmation for each site from the web service.

Which option is better?

1) Calling web service for every single record (site) and get the confirmation and then based on the confirmation I move the records accordingly. I know this might be very time consuming, but as I said my SSIS package might only run every six months

OR

2) Sending records to a web service in a batch and get the result. I don’t know how to do this though.

Any help or better solution is appreciated.

If the web service is already created, you might be stuck with whatever it supports. Often, web services have either a single record interface or a batch interface, but not both. If you have control over how it is implemented, then either option will work.

If the web sevice is capable of handling a batch, you just need to make sure your message conforms to what the web service expects. That could be by concatenating a large string together.

|||

Web Service is not implemented yet.Actually I have to implement the web service.Any clues on how to implement batch web services?

Thanks

|||

The message that the web service accepts needs to contain multiple items, and handle processing them in a batch.

For example, your message payload might contain:

<Websites>
<Website>A</Website>
<Website>B</Website>
<Website>C</Website>
</Websites>

Thursday, March 8, 2012

Calling a AS400 (IBM DB2) Stored Procedure from within SSIS Package

Hi:

I would like to find out how would I call an AS400 (IBM DB2) iSeries Stored Procedure from within my SSIS Package. What tasks should i be using? and do I need any additional adapters installed on my machine to access AS400(IBM DB2). Thanks.

MA

--Run this scrpit, AS400 is the name of your AS400 name
EXEC master.dbo.sp_addlinkedserver @.server = N'AS400', @.srvproduct=N'DB2 UDB for iSeries', @.provider=N'MSDASQL', @.datasrc=N'AS400', @.catalog=N'AS400DBNAME'
-- It will create a linked server name AS400, dtascrc parameter is the name of ODBC_DSN
--Open this linked server and add the UserID/Password--
Once this is done, then use the following to call the stored proc


Exec ('Call Library.StoredProc (?)') AT AS400

Task Name is Execute SQL Task, iSeries Navigator/drivers should be installed on the server.

This is very good article on this

http://www.mcpressonline.com/mc/.6b344718

Saturday, February 25, 2012

Call a SP many times in parallel

Hi,

Is there a way to call a SP several times in parallel from another SP?

I know I can create a DTS with several Tasks that work parallel. The issue is that I don't know how many parallel execution I need.

Thanks,

Assaf

No. Execution of the SP is always sequential.