Call DTS from Query Analyzer
- From: "Rumpelstiltskin" <timkovacs@xxxxxxxxx>
- Date: 26 Feb 2007 11:09:08 -0800
I'm trying to execute the following script from Query Analyzer. The
objective is to update the Global Variable in the DTS package. I'm not
getting any errors (@hr <> 0) yet the GV is not updating. I am a
sysadmin on the database.
DECLARE @hr int, @oPKG int, @name varchar(100)
SET @name = 'AL'
EXEC @hr = sp_OACreate 'DTS.Package', @oPKG OUT
EXEC @hr = sp_OAMethod @oPKG, 'LoadFromSQLServer',NULL, @@SERVERNAME,
@PackageName = 'WalkReport', @Flags = 256
EXEC @hr = sp_OASetProperty @oPKG,
'GlobalVariables("gv_Chapcode").Value', @name
EXEC @hr = sp_OAMethod @oPKG, 'Execute'
EXEC @hr = sp_OADestroy @oPKG
PS: Yes I've searched the groups but can't find out why mine would
fail.
Thanks,
Tim
.
- Prev by Date: Re: SQL Server 2005 64-bit - Fetch data from Oracle 8i?
- Next by Date: Re: Want to Transfer data to the Active Work*** in excel
- Previous by thread: Re: SQL Server 2005 64-bit - Fetch data from Oracle 8i?
- Next by thread: Re: Want to Transfer data to the Active Work*** in excel
- Index(es):