473,666 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP!! HOW TO CALL A DTS PACKAGE FROM A STORED PROC

I'm a rookie with MSSQL. I need to run a DTS package to export a result set
to an MX Excel spread sheet. I need to call the DTS from a stored procedure
and pass it three values, depending on the input parameters to the stored
proc.

DTS package is no problem. Pretty easy with the DTS wizard. My problem is
that I can't figure out how to instansiate the DTS package object from a
stored proc and pass the three values as parameters to the DTS package so
they can populate the parameters I created in it.

I found an article related to it, but I'm too much of a rookie to grasp it.
It showed how to do this from a stored procedure:

EXEC @hr = sp_OASetPropert y @oPKG, 'GlobalVariable s("MyGVName").V alue,
'MyGVValue'
IF @hr <> 0
BEGIN
PRINT '*** GlobalVariable Assignment Failed'
EXEC sp_displayoaerr orinfo @oPKG, @hr
END

I have three values and tree global variables to populate. Do I need to do
the above 3 times?

How do I instantiate the package object? I've read up some on sp_OACreate,
but I don't get it, yet.

How do I initiate the variable @oPKG?
It contains the name of the sp_OACreate string, right? How do I address a
DTS package in the sp_OACreate string?

I would really appreciate just writing out the sp_OACreate string and how I
pass values for three existing global variables to a DTS package named
"DTS_1".

I'm under some real pressure to get this done.

Thanks for any help I can get.
Gunny
Jul 20 '05 #1
1 11112
Hi

Check out

http://www.databasejournal.com/featu...le.php/1459181

A good resource for everything DTS are books online and
http://www.sqldts.com

John

"Cox News Server" <cf*****@cox.ne t> wrote in message
news:RJClb.9760 2$AH4.96936@lak eread06...
I'm a rookie with MSSQL. I need to run a DTS package to export a result set to an MX Excel spread sheet. I need to call the DTS from a stored procedure and pass it three values, depending on the input parameters to the stored
proc.

DTS package is no problem. Pretty easy with the DTS wizard. My problem is
that I can't figure out how to instansiate the DTS package object from a
stored proc and pass the three values as parameters to the DTS package so
they can populate the parameters I created in it.

I found an article related to it, but I'm too much of a rookie to grasp it. It showed how to do this from a stored procedure:

EXEC @hr = sp_OASetPropert y @oPKG, 'GlobalVariable s("MyGVName").V alue,
'MyGVValue'
IF @hr <> 0
BEGIN
PRINT '*** GlobalVariable Assignment Failed'
EXEC sp_displayoaerr orinfo @oPKG, @hr
END

I have three values and tree global variables to populate. Do I need to do
the above 3 times?

How do I instantiate the package object? I've read up some on sp_OACreate,
but I don't get it, yet.

How do I initiate the variable @oPKG?
It contains the name of the sp_OACreate string, right? How do I address a
DTS package in the sp_OACreate string?

I would really appreciate just writing out the sp_OACreate string and how I pass values for three existing global variables to a DTS package named
"DTS_1".

I'm under some real pressure to get this done.

Thanks for any help I can get.
Gunny

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3846
by: Dennis | last post by:
Is it possible to call a stored procedure asynchronously from an ASP page? We would like to be able to execute a proc and have the page continue to process without having to wait for the proc to finish. I know you can make a dll and call it from there, but we'd rather just be able to keep it simple and call it from the page if we can.
3
5943
by: William Buchanan | last post by:
Hi I have the following stored proc in interbase (which might contain errors - i'm doing it off the top of my head), which I would like to convert into oracle. Can you help? What I want back is a dataset of all the records where Ch_Val is different to the previous value. Thanks for any help. create procedure GetChanges(StartDate timestamp, EndDate timestamp)
0
2566
by: LisaC | last post by:
I am using ISQLW in an NT cmd script to call a bunch of scripts to build a database. One of the scripts requires an input parameter. How do I pass an input parameter through the cmd script? Here is my syntax. The first five input parameters specify the database, location of script, login name, password, etc. How do I give spc_Database an input parameter? IF "%1"=="" goto NoParameter IF "%2"=="" goto NoParameter
3
6150
by: Robert Song | last post by:
Hi all I am implementing a stored procedure which needs to recursively call itself until specific condition is reached, Could anyone give some advice about that? Thanks a lot Robert Song
0
7141
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE TRIGGER statement.) I've also defined a SQL stored proc, and the trigger is set to call this SP. I've posted the simplified source below. I can manually call the stored proc, and the external trigger is created without any errors. However, when I do...
0
948
by: Daniel | last post by:
how do i call a stored proc that looks like this from ADO.NET? ALTER PROCEDURE new_pzGetIDList ( @foo varbinary(8) ) i have it as a System.Byte in C#
2
1148
by: CK | last post by:
I have this CREATE PROCEDURE dbo.cmsGetTaskOrdersAndFunding2 ( @FundingDate SMALLDATETIME, @BillingContractID INT, -- null for all contracts @Filter BIT = NULL ) AS
1
1233
by: cwendell | last post by:
Hello; I am a DBA working on a new project with a developer using .NET and C#. I have created a Package (RECORDER_API) with a very simple Procedure in it (add_row). This package is owned by RECORD_OWNER. A synonym has been created for an account RECORD_USER. Execute on RECORDER_API has been granted a role (RECORDING) and this role has been granted to RECORD_USER. The Procedure add_row has a number of IN parameters but I am having problems...
0
1397
by: rsadalarasu | last post by:
Hi Everybody, I m very new to Db2. I tried compiling a stored procedure in DB2 Development Center. Build failed with error message like nmake command is unavailable..(something like that). I came to know that Db2 8.1 need VC++ to be installed to compile a stored procedure. Now the problem is I dont have VC++ installed in my machine. I need to compile the stored proc desperately. But some how i got the installed version of VC++ from...
0
1179
by: barmatt80 | last post by:
I have been trying to create a web service that calls a stored procedure that will accept one value call the sql stored procedure that returns 4 variables. I haven't done this ever before, and haven't found how to do it yet. It is a ms sql 2005 stored procedure. I was told I could not use http endpoints on the sql server. Any guidance or help with this? Thanks.
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.