Solved

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

Posted on 2004-08-26
2
464 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 100 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

752 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