dbTalk Databases Forums  

DTS : How to "Execute Process Task" from an Activex ?

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


Discuss DTS : How to "Execute Process Task" from an Activex ? in the microsoft.public.sqlserver.dts forum.



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

Default DTS : How to "Execute Process Task" from an Activex ? - 10-13-2003 , 11:45 AM






In my DTS, I got an Activex step in which I am preparing
a bat file (command file).
I know how to start it by creating a separate "Execute
Process Task" step, but then my bat filename must remain
identical each time, while I'd prefer to make it vary ...
To do so, either I can code inside my Activex the
launching of the bat file, or I may pass the bat filename
as parameter to the "Execute Process Task" step : The
thing is I have no idea at all on how to do that.

Please Help !!!

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

Default Re: How to "Execute Process Task" from an Activex ? - 10-13-2003 , 12:20 PM






Have a look at this

How to manipulate the Execute Process task.
(http://www.sqldts.com/default.aspx?251)

--
--

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

"Fred" <fredmoresco (AT) hotmail (DOT) com> wrote

Quote:
In my DTS, I got an Activex step in which I am preparing
a bat file (command file).
I know how to start it by creating a separate "Execute
Process Task" step, but then my bat filename must remain
identical each time, while I'd prefer to make it vary ...
To do so, either I can code inside my Activex the
launching of the bat file, or I may pass the bat filename
as parameter to the "Execute Process Task" step : The
thing is I have no idea at all on how to do that.

Please Help !!!



Reply With Quote
  #3  
Old   
moresco frederic
 
Posts: n/a

Default Re: DTS : How to "Execute Process Task" from an Activex ? - 10-14-2003 , 10:44 AM





Allan, Thank you very much ... this is perfect !

Now I meet another problem :
I'd like to find a way to send a few parameters to my DTS from an ASP
page.
I searched the web and couldnt find clear help on the subject ... I
could either call directly the DTS, or a stored procedure which should
then be able to call the DTS with parameters or to set global variables.

I found the following kind of stored proc somewhere ... but couldnt
make it work (the @sql value was different).

CREATE procedure my_sp @User varchar(50), @report int as

DECLARE @sql varchar(1000)
DECLARE @myDTS varchar(100)

SELECT @requestID = 1
SELECT @myDTS = "My appli : Treat User Requests"

select @sql="xp_cmdshell 'dtsrun /N" + @myDTS + " /E /AReq="+
convert(char(5),@requestID) + "'"

exec(@sql)
GO

I am sure many of you have needed this !

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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

Default Re: DTS : How to "Execute Process Task" from an Activex ? - 10-15-2003 , 01:15 AM



xp_cmdshell if you are not a sysadmin executes in the context of the proxy
account, when the user is a sysadmin then it executes as the SQL Server
Service account

From BOL
When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed
server role, xp_cmdshell will be executed under the security context in
which the SQL Server service is running. When the user is not a member of
the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy
account, which is specified using xp_sqlagent_proxy_account. If the proxy
account is not available, xp_cmdshell will fail. This is true only for
Microsoft® Windows NT® 4.0 and Windows 2000. On Windows 9.x, there is no
impersonation and xp_cmdshell is always executed under the security context
of the Windows 9.x user who started SQL Server.

You do not say WHAT the error is.

Your syntax looks to be missing the "Type Identifier" which is compulsory.

You will find them here in BOL

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\cop
rompt.chm::/cp_dtsrun_95kp.htm
--

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



"moresco frederic" <fredmoresco (AT) hotmail (DOT) com> wrote

Quote:

Allan, Thank you very much ... this is perfect !

Now I meet another problem :
I'd like to find a way to send a few parameters to my DTS from an ASP
page.
I searched the web and couldnt find clear help on the subject ... I
could either call directly the DTS, or a stored procedure which should
then be able to call the DTS with parameters or to set global variables.

I found the following kind of stored proc somewhere ... but couldnt
make it work (the @sql value was different).

CREATE procedure my_sp @User varchar(50), @report int as

DECLARE @sql varchar(1000)
DECLARE @myDTS varchar(100)

SELECT @requestID = 1
SELECT @myDTS = "My appli : Treat User Requests"

select @sql="xp_cmdshell 'dtsrun /N" + @myDTS + " /E /AReq="+
convert(char(5),@requestID) + "'"

exec(@sql)
GO

I am sure many of you have needed this !

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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 - 2012, Jelsoft Enterprises Ltd.