Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call function

Status
Not open for further replies.

nisha23

Programmer
Sep 23, 2003
19
US
Is there any way from DTS package I want to execute a function in VC++ and pass some parameters and in return get back value.
 
I never done this... But here is a suggestion

From your C++ program send the paramters into a
table and the retune value you can slecte from a table. Let me get into some more details.

assume you are passing 2 parameters.

1.) create a table with 4 columns, where you can insert this 2 paramters in col1 and col2,
2.) Create a DTS package to perform your task, where parameters you can set from the table that you inserted.
3.)At the end of the DTS insert values back to the cretaed table into col4.
4.)Then save the DTS pacakges as a VB file or structured fomrat. You can execute that as normal exe calls from any apps.

I will approch differnetly to call DTS from another tool, I will start the above way and in col3 I will insert some dummy value and create a TRIGGER.Trigger will help you with better performanceand troubleshooting will make it easier. Basically your pacakge will be completely executed on the SQL server, and app server wont be using any resource.
Its a tough task to explain. If you need further clarifications let me know.
Hope this helps you..


Life is short, so I want to retire early and have some fun in 'God's Own Country'...


Dr.Sql
Good Luck.
 
My scenario is
From Transform Data Task Properties, I will read one record and then I want to transform one column only, through my C++ dll function and get back and then write to my destination file. So on second record.

 
One more question that can I use like CreateObject or GetObject in Script and call that dll function in Transform Data Task.
 
Nisha,
From Transform Data Task Properties you can sql query
declare @col3 as int or char
select @col3=col3 from your new table created
select col1,col2,col3 from Mytable where col3=@col3
or
select a.col1,a.col2,a.col3 from Mytable a,Createdtable b where a.col3=bcol3

From my knowledge its not possible to call CreateObject or GetObject in Transformation Task but you can use 'ActiveX Script Task' to call that functions.

Hope this clears your question...


Life is short, so I want to retire early and have some fun in 'God's Own Country'...



Dr.Sql
Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top