Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ssis - execute stored procedure

Posted on 2010-09-20
5
Medium Priority
?
1,097 Views
Last Modified: 2013-11-10
I am trying to figure out how to execute a stored procedure from ssis. I have a working stored procedure. It has no parameters. I want to somehow execute it fro an ssis package. I found something at another site that says: Another option is to use expressions in the execute sql task editor.  You could create an expression for the SqlStatementSource property.  A simple example:"exec usp_SomeProc @somevar = '"+ @[User::strSomeVar]+"'"
but I could not figure out how to do that. I just want a simple EXEC dbo.usp_MAINTAIN_UDF_HISTORY.
0
Comment
Question by:qbjgqbjg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Expert Comment

by:vdr1620
ID: 33720247
Try using

"
SET FMTONLY ON
SET NOCOUNT ON

exec usp_SomeProc @somevar = '"+ @[User::strSomeVar]+"'"
0
 

Author Comment

by:qbjgqbjg
ID: 33720657
I was already using SET NOCOUNT ON. Actually I think I may have it figured out. I used execute sql task . And the trick was for the sql command, I had to spell out execute. So the command was
EXECUTE dbo.usp_MAINTAIN_UDF_HISTORY. It worked. Now I am trying to figure out how to make it send me an email if it fails.
0
 
LVL 30

Accepted Solution

by:
Reza Rad earned 1000 total points
ID: 33722188
if this is a data flow task, with ole db source,
set data access mode as "SQL Command"
and in sql command text, write like this:
exec mySP

instead of mySP write your stored procedure name,

if your stored procedure has any parameters you should use question mark as each of parameters. but if there is no parameter, just user exec mySP.


0
 
LVL 15

Assisted Solution

by:AmmarR
AmmarR earned 1000 total points
ID: 33723310
Dear qbjgqbjg:

just use a simple Execute SQL Task and type in exec SP_name and it should work fine

check image below, i am using it to call a store procedure and its working fine.
exec-SP.png
0
 

Author Comment

by:qbjgqbjg
ID: 33725516
I had already tried it with EXEC  dbo.usp_MAINTAIN_UDF_HISTORY in the execute sql task. It did not work. It produced an error.  EXECUTE dbo.usp_MAINTAIN_UDF_HISTORY does work.
We are using sql server 2005. So maybe there is a difference.
execute-stored-procedure.docx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question