dbTalk Databases Forums  

Saving a dts package to sql server in a stored proceudre

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Saving a dts package to sql server in a stored proceudre in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
J-T
 
Posts: n/a

Default Saving a dts package to sql server in a stored proceudre - 07-23-2005 , 08:16 PM






I m rtying to save a packahe from a COM structured file into sql server
database *using a trusted connection" using the follwoing code:

EXEC @rc = sp_OAMethod @objPackage, 'SaveToSQLServerAs' , null,@ServerName
= @@ServerName, @Flags = 256, @PackageName = @PackageName

but it returns :

failed to load package rc = -2147352570, package = MyPackageName

if I use this code and I provide user name and password ,then it works.Do I
have a sytax error in the above command

((This works perfect):

EXEC @rc = sp_OAMethod @objPackage, 'SaveToSQLServerAs' , null,@NewName =
@PackageName, @ServerName = @@ServerName, @ServerUserName = @Username,
@ServerPassword = @Password



Reply With Quote
  #2  
Old   
J-T
 
Posts: n/a

Default Re: Saving a dts package to sql server in a stored proceudre - 07-23-2005 , 08:57 PM






I actually solved the problem.
I should have change "'SaveToSQLServerAs" to "'SaveToSQLServer" and used the
code below instead and it worked

-- THIS OPERATION IS DONE UNDER THE SECURITY CONTEXT OF THE USER WHICH CALLS
THE STORED PROCEDURE (( WINDOWS AUTHENTICATION))
EXEC @rc = sp_OAMethod @objPackage, 'SaveToSQLServer' , null,@ServerName =
@@ServerName, @Flags = 256


Thanks

"J-T" <J-T (AT) nospam (DOT) com> wrote

Quote:
I m rtying to save a packahe from a COM structured file into sql server
database *using a trusted connection" using the follwoing code:

EXEC @rc = sp_OAMethod @objPackage, 'SaveToSQLServerAs' , null,@ServerName
= @@ServerName, @Flags = 256, @PackageName = @PackageName

but it returns :

failed to load package rc = -2147352570, package = MyPackageName

if I use this code and I provide user name and password ,then it works.Do
I have a sytax error in the above command

((This works perfect):

EXEC @rc = sp_OAMethod @objPackage, 'SaveToSQLServerAs' , null,@NewName =
@PackageName, @ServerName = @@ServerName, @ServerUserName = @Username,
@ServerPassword = @Password





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.