dbTalk Databases Forums  

Executing an SP from inside a SCRIPT

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Executing an SP from inside a SCRIPT in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
George Morton
 
Posts: n/a

Default Executing an SP from inside a SCRIPT - 09-24-2004 , 01:39 PM






I'd like to get a string stored in a SQL table directly into an ActiveX
Script. (More specifically, I am retrieving the name of a file which was the
last one processed. The log of files processed is already in a SQL table.
The table would be used to determine if the file has already been
processed.)
That's the "what". I'm stuck on the "how". Any ideas would be greatly
appreciated. George.



Reply With Quote
  #2  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Executing an SP from inside a SCRIPT - 09-24-2004 , 02:24 PM






You can use the FileScripting object to return the Name of the file and use
that in a manner of ways:

Assign name to a global variable - use parameters in your query for the log
Assign name to global variable (optional, I guess) - build SQL statement to
modify your ExecSQL command with the filename
Inside of your ActiveX task, write the data to a table.

I think I'd stick with the first option where possible. Put a ? in your query
and Parameters should become a choice. Assign the appropriate variable to
that parameter.

-Pete

"George Morton" <gmorton1 (AT) optonline (DOT) net> wrote:

Quote:
I'd like to get a string stored in a SQL table directly into an ActiveX
Script. (More specifically, I am retrieving the name of a file which was the
last one processed. The log of files processed is already in a SQL table.
The table would be used to determine if the file has already been
processed.)
That's the "what". I'm stuck on the "how". Any ideas would be greatly
appreciated. George.



Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Executing an SP from inside a SCRIPT - 09-25-2004 , 02:33 AM



Use the ExecuteSQL task to query the table and assign the value to a GV.

SELECT filename FROM TABLE WHERE ................

Hit the parameters button and assign the filename value to a GV

In the Active Script task you can use the name of the file then from the GV
in any way you want

MsgBox DTSGlobalVariables("LastProcessedFileName").Value



--

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"George Morton" <gmorton1 (AT) optonline (DOT) net> wrote

Quote:
I'd like to get a string stored in a SQL table directly into an ActiveX
Script. (More specifically, I am retrieving the name of a file which was
the
last one processed. The log of files processed is already in a SQL table.
The table would be used to determine if the file has already been
processed.)
That's the "what". I'm stuck on the "how". Any ideas would be greatly
appreciated. George.





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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.