Execute a stored procedure using SQL Server 2008 in SSIS - sql

I want to execute a stored procedure using a SSIS package.
The output that generates from this stored procedure will also a script, so I want to execute that script output too. Can I schedule this SSIS package using SQL Server Agent?

You can execute a stored procedure in an Execute SQL Task in SSIS and send the output to a variable. You can then read the content of that variable in a second Execute SQL Task.
And yes, you can schedule the package to execute via a SQL Server Agent job. See this link for details.
Cheers -

Related

Can I execute a stored procedure every month automatically without creating a job?

I do not have access to SQL Server Agent and would like to execute a stored procedure monthly from SQL Server Management Studio 14. I am trying to insert the syntax for a stored procedure that will ensure it will be executed anytime I log into the client.
How would I do this?

SSIS deployed package execution using parameter at runtime

I have a package which is deployed using SQL server agent.
I am executing the SQL server agent by calling a stored procedure.
i have declared some variables inside the ssis package ,i want to use these variables as parameter in stored procedure.
any body Please help me.
Thanks in advance.
If you are allowed to use xp_cmdshell you could use dtexec to execute the package from a stored procedure . Passing a parameter can be done like this:
exec xp_cmdshell 'dtexec /f "c:demo\demo.dtsx" set \package.configurations[Configuration1].properties[Variable].value;int-002'
This is not a best practice. I would prefer to use my stored procedure to write my variables to a table first and then read from that table in SSIS with an Execute SQL statement as you can read here Populate an SSIS variable using a SQL statement

Executing muliple Stored Procedures within a single SQL Server Agent Job

My SQL Server Agent job seems to execute the 1st SP cmd but not the second. Does anybody know how i get multiple commands into a single Server Agent job?
Use the GO command after executing each stored procedure.
Do you reference any FilteredViews in your sproc code? Then check this post and see if you can implement any of these solutions.

Executing a dtsx file from a stored procedure [duplicate]

This question already has answers here:
Execute SQL Server SSIS Package From Stored Procedure
(3 answers)
Closed 7 years ago.
I have a SSIS package in SQL Server 2005 that I want to execute from a stored procedure or trigger on a table insert or update.
How do I do it?
Thanks
A couple of options are:
Run the package by calling dtexec from the stored procedure
Write a CLR procedure that uses the SSIS object model to run the package
Create a SQL Agent job that runs the package and run the job using the sp_start_job stored procedure
See the following articles for further explanations
Running SSIS Package Programatically.
How to Call SSIS Package from the Stored Procedure
Execute SSIS Package from Stored Procedure with Parameters using DTEXEC Utility
You could create an unscheduled SQL Agent job that is configured to run the SSIS package. Then from your stored procedure or trigger, use sp_startjob to run the job.
sp_start_job: http://msdn.microsoft.com/en-us/library/ms186757.aspx

How to run a stored procedure automatically every day

How do I set up to run a stored procedure automatically every day in SQL Server 2008 R2?
Set up a SQL job http://msdn.microsoft.com/en-us/library/ms135739.aspx
You need to use the Job scheduler in the sql agent. Sql express doesn't include it so I just have a batch file run as a scheduled task to run it.
-James
Was discussed here:
Scheduled run of stored procedure on SQL server
Under SQL agent you need to go to the job scheduler and create a job that runs the stored proc. Once you have created the job you can create one or more schedules for the job. http://msdn.microsoft.com/en-us/library/ms135739.aspx