![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In SQL2000 I can execute a DTS package with this code just fine DTS.Package2Class test = new DTS.Package2Class(); object pVarPersistStgOfHost = null; test.LoadFromSQLServer("myServer",null,null,DTS.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,null,null,null,"myPackage",ref pVarPersistStgOfHost); test.Execute(); However the LoadFromSQLServer method is no longer part of the PackageClass in Yukon it is insead a part of the ApplicationClass which has no execute method. I cannot find any code samples on how to load a yukon package assign variables and execute the package from VS 2005 beta1. Thanks in advance to anyone who can help with this |
#3
| |||
| |||
|
|
In SQL2000 I can execute a DTS package with this code just fine DTS.Package2Class test = new DTS.Package2Class(); object pVarPersistStgOfHost = null; test.LoadFromSQLServer("myServer",null,null,DTS.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,null,null,null,"myPackage",ref pVarPersistStgOfHost); test.Execute(); However the LoadFromSQLServer method is no longer part of the PackageClass in Yukon it is insead a part of the ApplicationClass which has no execute method. I cannot find any code samples on how to load a yukon package assign variables and execute the package from VS 2005 beta1. Thanks in advance to anyone who can help with this |
#4
| |||
| |||
|
|
This would probably be better on the Beta NG but something like this may work. I have not tried this in a long while though (probably B1). Dim a As Application = New Application() Dim events As IDTSEvents ' Method 1: Load from the file system Dim p As Package = a.LoadPackage("c:\foo.dtsx", events) ' Method 2: load from SQL server Dim p2 As Package = a.LoadFromSqlServer("userName", "serverName", "serverUserName", "ServerPassword", events) ' Method 3: Load from the service Dim p3 As Package = a.LoadFromDtsServer("packagePath","serverName", events) ' Method 4: Load from an xml document Dim p4 As Package = New Package() Dim xmldoc As XmlDocument = New XmlDocument() xmldoc.Load("c:\package.dtsx") p4.LoadFromXML(xmldoc.OuterXml, events) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - SQL Server 2005 Integration Services. www.Konesans.com "jimd" <jimd (AT) discussions (DOT) microsoft.com> wrote In SQL2000 I can execute a DTS package with this code just fine DTS.Package2Class test = new DTS.Package2Class(); object pVarPersistStgOfHost = null; test.LoadFromSQLServer("myServer",null,null,DTS.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,null,null,null,"myPackage",ref pVarPersistStgOfHost); test.Execute(); However the LoadFromSQLServer method is no longer part of the PackageClass in Yukon it is insead a part of the ApplicationClass which has no execute method. I cannot find any code samples on how to load a yukon package assign variables and execute the package from VS 2005 beta1. Thanks in advance to anyone who can help with this |
#5
| |||
| |||
|
|
Thanks for the reply and the code examples The problem I see is that the Application Class cannot execute a package. While the Package Class can execute, however, it cannot load the package from SQL or DTS I am confused why there isn't isn't a LoadFromSQLServer method on the Package Class or a way to transfer the Package information from Application() to Package() |
#6
| |||
| |||
|
|
In message <7C854FA5-6AC8-469C-A3FB-699CBC734C89 (AT) microsoft (DOT) com>, jimd jimd (AT) discussions (DOT) microsoft.com> writes Thanks for the reply and the code examples The problem I see is that the Application Class cannot execute a package. While the Package Class can execute, however, it cannot load the package from SQL or DTS I am confused why there isn't isn't a LoadFromSQLServer method on the Package Class or a way to transfer the Package information from Application() to Package() The object model is basically a new object model, so you now use the application to load a package. You use the package class to store that package, as loaded via the application, so why does there need to be a load method on the package class? Yes it is all new, and a bit of learning curve, but is there actually something missing, or something that you cannot do? -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#7
| |||
| |||
|
|
I cannot find any samples on executing a SQL 2005 package using VS 2005 . All I found was saving the package as XML from the application and then using the package class to load and execute that xml. thanks again for the replies "Darren Green" wrote: In message <7C854FA5-6AC8-469C-A3FB-699CBC734C89 (AT) microsoft (DOT) com>, jimd jimd (AT) discussions (DOT) microsoft.com> writes Thanks for the reply and the code examples The problem I see is that the Application Class cannot execute a package. While the Package Class can execute, however, it cannot load the package from SQL or DTS I am confused why there isn't isn't a LoadFromSQLServer method on the Package Class or a way to transfer the Package information from Application() to Package() The object model is basically a new object model, so you now use the application to load a package. You use the package class to store that package, as loaded via the application, so why does there need to be a load method on the package class? Yes it is all new, and a bit of learning curve, but is there actually something missing, or something that you cannot do? -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |