|
Home > Archive > MS SQL Server DTS > July 2005 > Saving a dts package to sql server in a stored proceudre
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Saving a dts package to sql server in a stored proceudre
|
|
|
| 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
| |
|
| 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@nospam.com> wrote in message
news:%23jSqO1%23jFHA
.2484@TK2MSFTNGP15.phx.gbl...
>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
>
>
|
|
|
|
|