Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can I pass stored procedure name as global variable in DTS package?

Posted on 2004-08-26
2
Medium Priority
?
468 Views
Last Modified: 2006-11-17
Hi,

I have few stored procedures which are receiving the same input parameters(2 input parameters). May I know whether I can pass the stored procedure name as a global variable to my DTS package?

I tried to put the SQL statement as "EXEC ? ?, ?", where the first question mark is my stored procedure name, 2nd and 3rd question marks are the 2 input parameters. And I got "Syntax error or access violation" when I clicked on Parameter button.

Could you please advise?

Thank you very much!



-HL
0
Comment
Question by:hllim
[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
2 Comments
 
LVL 17

Accepted Solution

by:
BillAn1 earned 300 total points
ID: 11900560
I think what you will need to do is have a small stored procedure which takes 3 parameters and generates a dynamic SQL string from these and executes it e.g.

create procedure dynamic_proc (@sp_name varchar(100), @param1 int, @param2 int)
as
begin
declare @MySQL varchar(200)
set @MySQL = @sp_name + ' ' + @param1 + ',' + @param2
exec (@MySQL)
end

then your DTS SQLstatement can be
dynamic_proc ?,?,?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 11903436
In DTS, you can play around with the dynamic properties, this will allow you to do what you want...
Unfortunately, i don't have the software here to check it out. Learing by dogin ...
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

670 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