Uzak paket programlı olarak çalışan ve yükleme
Olmayan yerel bilgisayardan uzak paketleri çalıştırmak için Integration Servicesonlar da uzak bilgisayarda çalıştırmak yüklü paketleri başlaması Integration Servicesyüklenir. Yerel bilgisayar kullanımını sağlayarak, bunu SQL Serveraracı, bir Web hizmeti veya uzak bileşen paketleri uzak bilgisayarda başlatmak için. Doğrudan yerel bilgisayardan uzak paketler başlatmaya çalışırsanız, paketlerin üzerine yük ve yerel bilgisayardan çalıştırmayı deneyin. Yerel bilgisayarda yoksa Integration Servicesyüklü paketleri çalışmayacak.
[!NOT]
Paketler dışında çalışamaz SQL Server Veri Akışı Araçlarısahip olan bir istemci bilgisayarda Integration Servicesyüklü ve şartları, SQL ServerLisans yüklemenize izin Integration Servicesek bilgisayarlara. Integration Servicesbir sunucu bileşenidir ve istemci bilgisayarlara yeniden dağıtılabilir değil.
Değişimli, sen-ebilmek koşmak uzak paket olan yerel bir bilgisayardan Integration Servicesyüklü. Daha fazla bilgi için, bkz. Yükleme ve Yerel paket programlı olarak çalıştırmak.
Uzak bilgisayarda uzak bir paketi çalıştıran
Yukarıda belirtildiği gibi uzak bir sunucuda uzak paket çalıştırmak birden çok yolu vardır:
Uzak paket programlı olarak çalıştırmak için SQL Server Agent'ı kullanmak
Uzak paket programlı olarak çalıştırmak için bir Web hizmetini veya uzak bileşen kullanın
Bu konudaki yüklemek ve paketleri kaydetmek için kullanılan hemen hemen tüm yöntemleri başvuru gerektiren Microsoft.SqlServer.ManagedDTSMeclis. ado istisnadır.net bir yaklaşım göstermiş yürütme bu konudaki sp_start_job saklı yordamı yalnızca başvuru gerektiren System.Data. Başvurusunu ekledikten sonra Microsoft.SqlServer.ManagedDTSyeni bir proje, ithalat derleme Microsoft.SqlServer.Dts.Runtimead alanı ile bir usingya Importsdeyimi.
Uzak paket program aracılığıyla sunucuda çalıştırmak için SQL Server Agent'i kullanmak
Aşağıdaki kod örneği programlı olarak kullanımı gösterilmiştir SQL ServerAracısı uzak bir paketi sunucu üzerinde çalıştırmak için. Kod örneği sistem saklı yordamı çağıran sp_start_job, hangi denize indirmek a SQL ServerAracısı işi. Bu yordamı başlattı iş adlı RunSSISPackage, ve bu iş uzak bilgisayarda. RunSSISPackageİş sonra paketi uzak bilgisayarda çalıştırır.
[!NOT]
Dönüş değeri sp_start_job saklı yordamını başlatmak mümkün olup olmadığını gösterir saklı yordam SQL ServerAracısı iş başarılı. Dönüş değeri, paketi başarılı veya başarısız olup olmadığını göstermez.
Den çalıştırmak paketleri sorun giderme hakkında bilgi için SQL ServerAracısı işleri, Microsoft makalesine bakın SQL Server Agent iş adım SSIS paketi çağırdığınızda SSIS paketi çalışmaz.
Örnek kod
Imports System.Data
Imports System.Data.SqlClient
Module Module1
Sub Main()
Dim jobConnection As SqlConnection
Dim jobCommand As SqlCommand
Dim jobReturnValue As SqlParameter
Dim jobParameter As SqlParameter
Dim jobResult As Integer
jobConnection = New SqlConnection("Data Source=(local);Initial Catalog=msdb;Integrated Security=SSPI")
jobCommand = New SqlCommand("sp_start_job", jobConnection)
jobCommand.CommandType = CommandType.StoredProcedure
jobReturnValue = New SqlParameter("@RETURN_VALUE", SqlDbType.Int)
jobReturnValue.Direction = ParameterDirection.ReturnValue
jobCommand.Parameters.Add(jobReturnValue)
jobParameter = New SqlParameter("@job_name", SqlDbType.VarChar)
jobParameter.Direction = ParameterDirection.Input
jobCommand.Parameters.Add(jobParameter)
jobParameter.Value = "RunSSISPackage"
jobConnection.Open()
jobCommand.ExecuteNonQuery()
jobResult = DirectCast(jobCommand.Parameters("@RETURN_VALUE").Value, Integer)
jobConnection.Close()
Select Case jobResult
Case 0
Console.WriteLine("SQL Server Agent job, RunSISSPackage, started successfully.")
Case Else
Console.WriteLine("SQL Server Agent job, RunSISSPackage, failed to start.")
End Select
Console.Read()
End Sub
End Module
Imports System.Data
Imports System.Data.SqlClient
Module Module1
Sub Main()
Dim jobConnection As SqlConnection
Dim jobCommand As SqlCommand
Dim jobReturnValue As SqlParameter
Dim jobParameter As SqlParameter
Dim jobResult As Integer
jobConnection = New SqlConnection("Data Source=(local);Initial Catalog=msdb;Integrated Security=SSPI")
jobCommand = New SqlCommand("sp_start_job", jobConnection)
jobCommand.CommandType = CommandType.StoredProcedure
jobReturnValue = New SqlParameter("@RETURN_VALUE", SqlDbType.Int)
jobReturnValue.Direction = ParameterDirection.ReturnValue
jobCommand.Parameters.Add(jobReturnValue)
jobParameter = New SqlParameter("@job_name", SqlDbType.VarChar)
jobParameter.Direction = ParameterDirection.Input
jobCommand.Parameters.Add(jobParameter)
jobParameter.Value = "RunSSISPackage"
jobConnection.Open()
jobCommand.ExecuteNonQuery()
jobResult = DirectCast(jobCommand.Parameters("@RETURN_VALUE").Value, Integer)
jobConnection.Close()
Select Case jobResult
Case 0
Console.WriteLine("SQL Server Agent job, RunSISSPackage, started successfully.")
Case Else
Console.WriteLine("SQL Server Agent job, RunSISSPackage, failed to start.")
End Select
Console.Read()
End Sub
End Module
using System;
using System.Data;
using System.Data.SqlClient;
namespace LaunchSSISPackageAgent_CS
{
class Program
{
static void Main(string[] args)
{
SqlConnection jobConnection;
SqlCommand jobCommand;
SqlParameter jobReturnValue;
SqlParameter jobParameter;
int jobResult;
jobConnection = new SqlConnection("Data Source=(local);Initial Catalog=msdb;Integrated Security=SSPI");
jobCommand = new SqlCommand("sp_start_job", jobConnection);
jobCommand.CommandType = CommandType.StoredProcedure;
jobReturnValue = new SqlParameter("@RETURN_VALUE", SqlDbType.Int);
jobReturnValue.Direction = ParameterDirection.ReturnValue;
jobCommand.Parameters.Add(jobReturnValue);
jobParameter = new SqlParameter("@job_name", SqlDbType.VarChar);
jobParameter.Direction = ParameterDirection.Input;
jobCommand.Parameters.Add(jobParameter);
jobParameter.Value = "RunSSISPackage";
jobConnection.Open();
jobCommand.ExecuteNonQuery();
jobResult = (Int32)jobCommand.Parameters["@RETURN_VALUE"].Value;
jobConnection.Close();
switch (jobResult)
{
case 0:
Console.WriteLine("SQL Server Agent job, RunSISSPackage, started successfully.");
break;
default:
Console.WriteLine("SQL Server Agent job, RunSISSPackage, failed to start.");
break;
}
Console.Read();
}
}
}
using System;
using System.Data;
using System.Data.SqlClient;
namespace LaunchSSISPackageAgent_CS
{
class Program
{
static void Main(string[] args)
{
SqlConnection jobConnection;
SqlCommand jobCommand;
SqlParameter jobReturnValue;
SqlParameter jobParameter;
int jobResult;
jobConnection = new SqlConnection("Data Source=(local);Initial Catalog=msdb;Integrated Security=SSPI");
jobCommand = new SqlCommand("sp_start_job", jobConnection);
jobCommand.CommandType = CommandType.StoredProcedure;
jobReturnValue = new SqlParameter("@RETURN_VALUE", SqlDbType.Int);
jobReturnValue.Direction = ParameterDirection.ReturnValue;
jobCommand.Parameters.Add(jobReturnValue);
jobParameter = new SqlParameter("@job_name", SqlDbType.VarChar);
jobParameter.Direction = ParameterDirection.Input;
jobCommand.Parameters.Add(jobParameter);
jobParameter.Value = "RunSSISPackage";
jobConnection.Open();
jobCommand.ExecuteNonQuery();
jobResult = (Int32)jobCommand.Parameters["@RETURN_VALUE"].Value;
jobConnection.Close();
switch (jobResult)
{
case 0:
Console.WriteLine("SQL Server Agent job, RunSISSPackage, started successfully.");
break;
default:
Console.WriteLine("SQL Server Agent job, RunSISSPackage, failed to start.");
break;
}
Console.Read();
}
}
}
Başa dön
Uzak paket programlı olarak çalıştırmak için bir Web hizmetini veya uzak bileşen kullanma
Önceki çözüm paketleri program aracılığıyla sunucuda çalıştırmak için sunucuda herhangi bir özel kod gerektirmez. Ancak, bir çözüm paketleri çalıştırmak için SQL Server Agent üzerinde dayanmaz tercih edebilirsiniz. Aşağıdaki örnek, bir Web hizmeti başlatmak için sunucuda oluşturulan gösterir Integration Servicespaketleri yerel olarak ve bir istemci bilgisayardan Web hizmeti çağrısı için kullanılan bir sınama uygulaması. Bir Web hizmeti yerine uzak bileşen oluşturmak isterseniz, uzak bileşen çok az değişikliklerle aynı kod mantığı kullanabilirsiniz. Ancak uzak bileşen, bir Web hizmetinden daha kapsamlı yapılandırma gerektirebilir.
Önemli |
---|
Kimlik doğrulama ve yetkilendirme için varsayılan ayarlarıyla, bir Web Servisi genellikle yüklemek ve paketleri çalıştırmak için SQL Server ya da dosya sistemine erişmek için gereken izinlere sahip değil. Kimlik doğrulama ve yetkilendirme ayarlarını yapılandırarak Web hizmetine uygun izinleri atamak olabilir web.configdosyası ve veritabanı ve dosya sistemi izinlerinin uygun atama. Web, veritabanı ve dosya sistemi izinleri tam bir tartışma, bu konunun kapsamı dışında olduğunu. |
Önemli |
---|
Yöntemleri Applicationsınıfı için çalışma ile SSIS paketi depo desteği yalnızca ".", localhost veya sunucu adı yerel sunucu için. "(Yerel) kullanamazsınız. |
Örnek kod
Aşağıdaki kod örnekleri nasıl oluşturulacağı ve Web hizmetini sınama göster.
Web hizmeti oluşturma
Bir Integration Servicespaketi yüklü bir dosyadan doğrudan, doğrudan SQL Server veya gelen SSIS paketi paketi depolama SQL Server ve özel dosya sistemi klasörleri yöneten depo,. Bu örnek kullanarak tüm kullanılabilir seçenekleri destekler bir Select Caseya switchYapı paketi başlangıç için uygun sözdizimini seçin ve giriş bağımsız değişkenleri uygun şekilde bir arada. LaunchPackage Web hizmeti yöntemi yerine bir tamsayı paketi yürütme sonucunu verir bir DTSExecResultböylece istemci bilgisayarların herhangi bir başvuru gerektirmeyen değer Integration Servicesderlemeler.
Paketleri program aracılığıyla sunucuda çalıştırmak için bir Web hizmeti oluşturmak için
Visual Studio'nun açın ve tercih ettiğiniz programlama dili Web hizmeti projesi oluşturun. Örnek kod adı LaunchSSISPackageService proje için kullanır.
Başvuru eklemek Microsoft.SqlServer.ManagedDTSve bir Importsya usingdeyimi için kod dosyasına Microsoft.SqlServer.Dts.Runtimead.
LaunchPackage Web hizmeti yöntemi örnek kod sınıf yapıştırın. (Örnek kod penceresinin tüm içeriğini gösterir.)
Oluşturmak ve varolan bir paketi gösteren giriş bağımsız değişkenler LaunchPackage yöntemi için geçerli değerler sağlayarak Web hizmetini sınama. Package1.dtsx C:\My paketleri sunucuda saklanıyorsa, örneğin, "Dosya" geçmek sourceType, "C:\My paketleri" değer olarak sourceLocation ve "package1" değeri olarak (uzantı olmadan) PaketAdı değeri olarak.
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
<WebService(Namespace:="http://dtsue/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class LaunchSSISPackageService
Inherits System.Web.Services.WebService
' LaunchPackage Method Parameters:
' 1. sourceType: file, sql, dts
' 2. sourceLocation: file system folder, (none), logical folder
' 3. packageName: for file system, ".dtsx" extension is appended
<WebMethod()> _
Public Function LaunchPackage( _
ByVal sourceType As String, _
ByVal sourceLocation As String, _
ByVal packageName As String) As Integer 'DTSExecResult
Dim packagePath As String
Dim myPackage As Package
Dim integrationServices As New Application
' Combine path and file name.
packagePath = Path.Combine(sourceLocation, packageName)
Select Case sourceType
Case "file"
' Package is stored as a file.
' Add extension if not present.
If String.IsNullOrEmpty(Path.GetExtension(packagePath)) Then
packagePath = String.Concat(packagePath, ".dtsx")
End If
If File.Exists(packagePath) Then
myPackage = integrationServices.LoadPackage(packagePath, Nothing)
Else
Throw New ApplicationException( _
"Invalid file location: " & packagePath)
End If
Case "sql"
' Package is stored in MSDB.
' Combine logical path and package name.
If integrationServices.ExistsOnSqlServer(packagePath, ".", String.Empty, String.Empty) Then
myPackage = integrationServices.LoadFromSqlServer( _
packageName, "(local)", String.Empty, String.Empty, Nothing)
Else
Throw New ApplicationException( _
"Invalid package name or location: " & packagePath)
End If
Case "dts"
' Package is managed by SSIS Package Store.
' Default logical paths are File System and MSDB.
If integrationServices.ExistsOnDtsServer(packagePath, ".") Then
myPackage = integrationServices.LoadFromDtsServer(packagePath, "localhost", Nothing)
Else
Throw New ApplicationException( _
"Invalid package name or location: " & packagePath)
End If
Case Else
Throw New ApplicationException( _
"Invalid sourceType argument: valid values are 'file', 'sql', and 'dts'.")
End Select
Return myPackage.Execute()
End Function
End Class
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
<WebService(Namespace:="http://dtsue/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class LaunchSSISPackageService
Inherits System.Web.Services.WebService
' LaunchPackage Method Parameters:
' 1. sourceType: file, sql, dts
' 2. sourceLocation: file system folder, (none), logical folder
' 3. packageName: for file system, ".dtsx" extension is appended
<WebMethod()> _
Public Function LaunchPackage( _
ByVal sourceType As String, _
ByVal sourceLocation As String, _
ByVal packageName As String) As Integer 'DTSExecResult
Dim packagePath As String
Dim myPackage As Package
Dim integrationServices As New Application
' Combine path and file name.
packagePath = Path.Combine(sourceLocation, packageName)
Select Case sourceType
Case "file"
' Package is stored as a file.
' Add extension if not present.
If String.IsNullOrEmpty(Path.GetExtension(packagePath)) Then
packagePath = String.Concat(packagePath, ".dtsx")
End If
If File.Exists(packagePath) Then
myPackage = integrationServices.LoadPackage(packagePath, Nothing)
Else
Throw New ApplicationException( _
"Invalid file location: " & packagePath)
End If
Case "sql"
' Package is stored in MSDB.
' Combine logical path and package name.
If integrationServices.ExistsOnSqlServer(packagePath, ".", String.Empty, String.Empty) Then
myPackage = integrationServices.LoadFromSqlServer( _
packageName, "(local)", String.Empty, String.Empty, Nothing)
Else
Throw New ApplicationException( _
"Invalid package name or location: " & packagePath)
End If
Case "dts"
' Package is managed by SSIS Package Store.
' Default logical paths are File System and MSDB.
If integrationServices.ExistsOnDtsServer(packagePath, ".") Then
myPackage = integrationServices.LoadFromDtsServer(packagePath, "localhost", Nothing)
Else
Throw New ApplicationException( _
"Invalid package name or location: " & packagePath)
End If
Case Else
Throw New ApplicationException( _
"Invalid sourceType argument: valid values are 'file', 'sql', and 'dts'.")
End Select
Return myPackage.Execute()
End Function
End Class
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using Microsoft.SqlServer.Dts.Runtime;
using System.IO;
[WebService(Namespace = "http://dtsue/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class LaunchSSISPackageServiceCS : System.Web.Services.WebService
{
public LaunchSSISPackageServiceCS()
{
}
// LaunchPackage Method Parameters:
// 1. sourceType: file, sql, dts
// 2. sourceLocation: file system folder, (none), logical folder
// 3. packageName: for file system, ".dtsx" extension is appended
[WebMethod]
public int LaunchPackage(string sourceType, string sourceLocation, string packageName)
{
string packagePath;
Package myPackage;
Application integrationServices = new Application();
// Combine path and file name.
packagePath = Path.Combine(sourceLocation, packageName);
switch(sourceType)
{
case "file":
// Package is stored as a file.
// Add extension if not present.
if (String.IsNullOrEmpty(Path.GetExtension(packagePath)))
{
packagePath = String.Concat(packagePath, ".dtsx");
}
if (File.Exists(packagePath))
{
myPackage = integrationServices.LoadPackage(packagePath, null);
}
else
{
throw new ApplicationException("Invalid file location: "+packagePath);
}
break;
case "sql":
// Package is stored in MSDB.
// Combine logical path and package name.
if (integrationServices.ExistsOnSqlServer(packagePath, ".", String.Empty, String.Empty))
{
myPackage = integrationServices.LoadFromSqlServer(packageName, "(local)", String.Empty, String.Empty, null);
}
else
{
throw new ApplicationException("Invalid package name or location: "+packagePath);
}
break;
case "dts":
// Package is managed by SSIS Package Store.
// Default logical paths are File System and MSDB.
if (integrationServices.ExistsOnDtsServer(packagePath, "."))
{
myPackage = integrationServices.LoadFromDtsServer(packagePath, "localhost", null);
}
else
{
throw new ApplicationException("Invalid package name or location: "+packagePath);
}
break;
default:
throw new ApplicationException("Invalid sourceType argument: valid values are 'file', 'sql', and 'dts'.");
}
return (Int32)myPackage.Execute();
}
}
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using Microsoft.SqlServer.Dts.Runtime;
using System.IO;
[WebService(Namespace = "http://dtsue/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class LaunchSSISPackageServiceCS : System.Web.Services.WebService
{
public LaunchSSISPackageServiceCS()
{
}
// LaunchPackage Method Parameters:
// 1. sourceType: file, sql, dts
// 2. sourceLocation: file system folder, (none), logical folder
// 3. packageName: for file system, ".dtsx" extension is appended
[WebMethod]
public int LaunchPackage(string sourceType, string sourceLocation, string packageName)
{
string packagePath;
Package myPackage;
Application integrationServices = new Application();
// Combine path and file name.
packagePath = Path.Combine(sourceLocation, packageName);
switch(sourceType)
{
case "file":
// Package is stored as a file.
// Add extension if not present.
if (String.IsNullOrEmpty(Path.GetExtension(packagePath)))
{
packagePath = String.Concat(packagePath, ".dtsx");
}
if (File.Exists(packagePath))
{
myPackage = integrationServices.LoadPackage(packagePath, null);
}
else
{
throw new ApplicationException("Invalid file location: "+packagePath);
}
break;
case "sql":
// Package is stored in MSDB.
// Combine logical path and package name.
if (integrationServices.ExistsOnSqlServer(packagePath, ".", String.Empty, String.Empty))
{
myPackage = integrationServices.LoadFromSqlServer(packageName, "(local)", String.Empty, String.Empty, null);
}
else
{
throw new ApplicationException("Invalid package name or location: "+packagePath);
}
break;
case "dts":
// Package is managed by SSIS Package Store.
// Default logical paths are File System and MSDB.
if (integrationServices.ExistsOnDtsServer(packagePath, "."))
{
myPackage = integrationServices.LoadFromDtsServer(packagePath, "localhost", null);
}
else
{
throw new ApplicationException("Invalid package name or location: "+packagePath);
}
break;
default:
throw new ApplicationException("Invalid sourceType argument: valid values are 'file', 'sql', and 'dts'.");
}
return (Int32)myPackage.Execute();
}
}
Web hizmetini sınama
Aşağıdaki örnek konsol uygulaması, bir paketi çalıştırmak için Web hizmeti kullanır. Web hizmeti yöntemi LaunchPackage yerine bir tamsayı paketi yürütme sonucunu verir bir DTSExecResultböylece istemci bilgisayarların herhangi bir başvuru gerektirmeyen değer Integration Servicesderlemeler. Örnek özel bir numaralandırma olan değerleri yansıtma oluşturur DTSExecResultdeğerler Yürütme sonuçlarını raporlamak için.
Web hizmetini sınama için bir konsol uygulaması oluşturmak için
Visual Studio'da Web hizmeti projesi içeren aynı çözümü tercih ettiğiniz programlama dili kullanarak yeni bir konsol uygulaması ekleyin. Örnek kod adı LaunchSSISPackageTest proje için kullanır.
Yeni konsol uygulaması çözüm başlangıç projesi olarak ayarlayın.
Web hizmeti projesi için Web başvurusu ekleyin. Gerekirse, örnek kod için Web hizmeti proxy nesnesine atadığınız adı bildiriminde ayarlayabilirsiniz.
Örnek kod Main yordamı ve özel numaralandırma için kodu yapıştırın. (Örnek kod penceresinin tüm içeriğini gösterir.)
Varolan bir paketi gösteren giriş bağımsız değişkenler için geçerli değerler sağlamak için LaunchPackage yöntemini çağıran kod satırı düzenleyin. Package1.dtsx C:\My paketleri sunucuda saklanıyorsa, örneğin, "Dosya" geçmek değeri olarak sourceType, "C:\My paketleri" değeri olarak sourceLocationve "package1" (uzantı olmadan) değeri olarak packageName.
Module LaunchSSISPackageTest
Sub Main()
Dim launchPackageService As New LaunchSSISPackageService.LaunchSSISPackageService
Dim packageResult As Integer
Try
packageResult = launchPackageService.LaunchPackage("sql", String.Empty, "SimpleTestPackage")
Catch ex As Exception
' The type of exception returned by a Web service is:
' System.Web.Services.Protocols.SoapException
Console.WriteLine("The following exception occurred: " & ex.Message)
End Try
Console.WriteLine(CType(packageResult, PackageExecutionResult).ToString)
Console.ReadKey()
End Sub
Private Enum PackageExecutionResult
PackageSucceeded
PackageFailed
PackageCompleted
PackageWasCancelled
End Enum
End Module
Module LaunchSSISPackageTest
Sub Main()
Dim launchPackageService As New LaunchSSISPackageService.LaunchSSISPackageService
Dim packageResult As Integer
Try
packageResult = launchPackageService.LaunchPackage("sql", String.Empty, "SimpleTestPackage")
Catch ex As Exception
' The type of exception returned by a Web service is:
' System.Web.Services.Protocols.SoapException
Console.WriteLine("The following exception occurred: " & ex.Message)
End Try
Console.WriteLine(CType(packageResult, PackageExecutionResult).ToString)
Console.ReadKey()
End Sub
Private Enum PackageExecutionResult
PackageSucceeded
PackageFailed
PackageCompleted
PackageWasCancelled
End Enum
End Module
using System;
namespace LaunchSSISPackageSvcTestCS
{
class Program
{
static void Main(string[] args)
{
LaunchSSISPackageServiceCS.LaunchSSISPackageServiceCS launchPackageService = new LaunchSSISPackageServiceCS.LaunchSSISPackageServiceCS();
int packageResult = 0;
try
{
packageResult = launchPackageService.LaunchPackage("sql", String.Empty, "SimpleTestPackage");
}
catch (Exception ex)
{
// The type of exception returned by a Web service is:
// System.Web.Services.Protocols.SoapException
Console.WriteLine("The following exception occurred: " + ex.Message);
}
Console.WriteLine(((PackageExecutionResult)packageResult).ToString());
Console.ReadKey();
}
private enum PackageExecutionResult
{
PackageSucceeded,
PackageFailed,
PackageCompleted,
PackageWasCancelled
};
}
}
using System;
namespace LaunchSSISPackageSvcTestCS
{
class Program
{
static void Main(string[] args)
{
LaunchSSISPackageServiceCS.LaunchSSISPackageServiceCS launchPackageService = new LaunchSSISPackageServiceCS.LaunchSSISPackageServiceCS();
int packageResult = 0;
try
{
packageResult = launchPackageService.LaunchPackage("sql", String.Empty, "SimpleTestPackage");
}
catch (Exception ex)
{
// The type of exception returned by a Web service is:
// System.Web.Services.Protocols.SoapException
Console.WriteLine("The following exception occurred: " + ex.Message);
}
Console.WriteLine(((PackageExecutionResult)packageResult).ToString());
Console.ReadKey();
}
private enum PackageExecutionResult
{
PackageSucceeded,
PackageFailed,
PackageCompleted,
PackageWasCancelled
};
}
}
Başa dön
Dış Kaynaklar
- Video nasıl yapılır: SQL Server Agent (SQL Server Video) kullanarak SSIS paketi yürütme otomatikleştirme, technet.microsoft.com üzerinde
|
Ayrıca bkz.
Görevler
Yükleme ve Yerel paket programlı olarak çalıştırmak