dbTalk Databases Forums  

calling SSIS package from stored procedure

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


Discuss calling SSIS package from stored procedure in the microsoft.public.sqlserver.dts forum.



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

Default calling SSIS package from stored procedure - 06-27-2006 , 02:08 PM






I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the the
right approach or is there a better way? Is there an alternate way to
call an SSIS package from a stored procedure? any help is appreciated.
Thanks.

Dave Christman


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: calling SSIS package from stored procedure - 06-28-2006 , 01:48 PM






Hello hedgracer,

Quote:
I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the the
right approach or is there a better way? Is there an alternate way to
call an SSIS package from a stored procedure? any help is appreciated.
Thanks.

Dave Christman

The xp_cmdshell extended stored procedure allows you to command line programs

The only other alternative is to create a job, and then call sp_start_job.




Reply With Quote
  #3  
Old   
SSM
 
Posts: n/a

Default Re: calling SSIS package from stored procedure - 06-28-2006 , 04:00 PM



Darren - I have setup a sp to execute dtexec using xp_cmdshell and this is
working great as long as the user is in the sysadmin db role. I understand
that if a non-sysadmin user executes my sp, SQL Server 2005 will attempt to
use the cmd shell proxy account - if it doesn't exist the exec will fail. I
have created a local Windows account and used this account for the cmd shell
proxy credential. When the non-sysadmin user attempts to execute my sp, the
proc returns the following error. What am i missing?

Microsoft OLE DB Provider for SQL Server error '80040e09'

EXECUTE permission denied on object 'xp_cmdshell', database
'mssqlsystemresource', schema 'sys'.


"Darren Green" wrote:

Quote:
Hello hedgracer,

I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the the
right approach or is there a better way? Is there an alternate way to
call an SSIS package from a stored procedure? any help is appreciated.
Thanks.

Dave Christman


The xp_cmdshell extended stored procedure allows you to command line programs

The only other alternative is to create a job, and then call sp_start_job.




Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: calling SSIS package from stored procedure - 06-28-2006 , 07:25 PM



Hello SSM,

The error message looks pretty clear to me, how about granting permissions
on xp_cmdshell to your user (the one making the connection to SQL Server
to call xp_cmshell), have you done that?

This is a bad idea though from a security perspective though, please be aware
of that.

Darren

Quote:
Darren - I have setup a sp to execute dtexec using xp_cmdshell and
this is working great as long as the user is in the sysadmin db role.
I understand that if a non-sysadmin user executes my sp, SQL Server
2005 will attempt to use the cmd shell proxy account - if it doesn't
exist the exec will fail. I have created a local Windows account and
used this account for the cmd shell proxy credential. When the
non-sysadmin user attempts to execute my sp, the proc returns the
following error. What am i missing?

Microsoft OLE DB Provider for SQL Server error '80040e09'

EXECUTE permission denied on object 'xp_cmdshell', database
'mssqlsystemresource', schema 'sys'.

"Darren Green" wrote:

Hello hedgracer,

I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the
the right approach or is there a better way? Is there an alternate
way to call an SSIS package from a stored procedure? any help is
appreciated. Thanks.

Dave Christman

The xp_cmdshell extended stored procedure allows you to command line
programs

The only other alternative is to create a job, and then call
sp_start_job.




Reply With Quote
  #5  
Old   
SSM
 
Posts: n/a

Default Re: calling SSIS package from stored procedure - 06-28-2006 , 08:31 PM



Thank you Darren - I appreciate the response. Yes, I thought the error msg
was pretty clear too and did grant execute permissions to xp_cmdshell for the
application login. This did not work either. And like you, I am concerned
with the security implications of doing so. Let me take this from a
different approach. Is there a means to use the SSIS/DTS object model, .NET,
and CLR integration to execute a SSIS package from a stored procedure?

"Darren Green" wrote:

Quote:
Hello SSM,

The error message looks pretty clear to me, how about granting permissions
on xp_cmdshell to your user (the one making the connection to SQL Server
to call xp_cmshell), have you done that?

This is a bad idea though from a security perspective though, please be aware
of that.

Darren

Darren - I have setup a sp to execute dtexec using xp_cmdshell and
this is working great as long as the user is in the sysadmin db role.
I understand that if a non-sysadmin user executes my sp, SQL Server
2005 will attempt to use the cmd shell proxy account - if it doesn't
exist the exec will fail. I have created a local Windows account and
used this account for the cmd shell proxy credential. When the
non-sysadmin user attempts to execute my sp, the proc returns the
following error. What am i missing?

Microsoft OLE DB Provider for SQL Server error '80040e09'

EXECUTE permission denied on object 'xp_cmdshell', database
'mssqlsystemresource', schema 'sys'.

"Darren Green" wrote:

Hello hedgracer,

I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the
the right approach or is there a better way? Is there an alternate
way to call an SSIS package from a stored procedure? any help is
appreciated. Thanks.

Dave Christman

The xp_cmdshell extended stored procedure allows you to command line
programs

The only other alternative is to create a job, and then call
sp_start_job.





Reply With Quote
  #6  
Old   
SSM
 
Posts: n/a

Default Re: calling SSIS package from stored procedure - 06-28-2006 , 11:43 PM



I resolved my issue with xp_cmdshell as follows....

I had already tried granting the user execution permissions to the sp
without success (I did not want to create this security hole either)- I
started getting a different error message. One related to the object being
closed. I thought this error message was related to cmdshell. After some
research, I found this error message was related to an empty recordset being
returned to ASP. After some further research, I found that the command line
statement was reporting that it could not open the SSIS package. This was
hidden by the no_output clause in the cmdshell execution.

After working through this, I found that I did setup the Windows account and
cmdshell proxy correctly. I also had the Windows account setup as a database
login with sysadmin database role correctly. The additional steps I took
were adding the 'with execute as owner' clause to the stored procedure being
executed and giving the Windows account permissions to the file subdir where
I store the SSIS packages.


"SSM" wrote:

Quote:
Thank you Darren - I appreciate the response. Yes, I thought the error msg
was pretty clear too and did grant execute permissions to xp_cmdshell for the
application login. This did not work either. And like you, I am concerned
with the security implications of doing so. Let me take this from a
different approach. Is there a means to use the SSIS/DTS object model, .NET,
and CLR integration to execute a SSIS package from a stored procedure?

"Darren Green" wrote:

Hello SSM,

The error message looks pretty clear to me, how about granting permissions
on xp_cmdshell to your user (the one making the connection to SQL Server
to call xp_cmshell), have you done that?

This is a bad idea though from a security perspective though, please be aware
of that.

Darren

Darren - I have setup a sp to execute dtexec using xp_cmdshell and
this is working great as long as the user is in the sysadmin db role.
I understand that if a non-sysadmin user executes my sp, SQL Server
2005 will attempt to use the cmd shell proxy account - if it doesn't
exist the exec will fail. I have created a local Windows account and
used this account for the cmd shell proxy credential. When the
non-sysadmin user attempts to execute my sp, the proc returns the
following error. What am i missing?

Microsoft OLE DB Provider for SQL Server error '80040e09'

EXECUTE permission denied on object 'xp_cmdshell', database
'mssqlsystemresource', schema 'sys'.

"Darren Green" wrote:

Hello hedgracer,

I am going to have a stored procedure that will call and execute an
SSIS package. I was going to use the DTexec utilility but have not
found out how to call that utility from a stored procedure. Is the
the right approach or is there a better way? Is there an alternate
way to call an SSIS package from a stored procedure? any help is
appreciated. Thanks.

Dave Christman

The xp_cmdshell extended stored procedure allows you to command line
programs

The only other alternative is to create a job, and then call
sp_start_job.





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.