📄 dtspkg.h
字号:
DTSErrorMode_FailStep = 0x0002, // Fail Step Execution
DTSErrorMode_FailPackage = 0x0003, // Fail Package Execution.
} DTS_ENUM_END(DTSErrorMode);
typedef DTS_ENUM_BEGIN(DTSCustomTaskUIFlags, "Specifies flags indicating the type of UI supported by the custom task") {
DTSCustomTaskUIFlags_Default = 0x0000,
DTSCustomTaskUIFlags_DoesCustomToolTip = 0x0001,
} DTS_ENUM_END(DTSCustomTaskUIFlags);
typedef DTS_ENUM_BEGIN(DTSRepositoryStorageFlags, "Specifies Repository options when saving or loading the DTS Package") {
DTSReposFlag_Default = 0x0000,
// How to connect to the repository.
DTSReposFlag_UseTrustedConnection = 0x0100, // Use NT integrated security to connect to Repository (MS SQL Server-hosted Repository only)
} DTS_ENUM_END(DTSRepositoryStorageFlags);
typedef DTS_ENUM_BEGIN(DTSSQLServerStorageFlags, "Specifies Repository options when saving or loading the DTS Package") {
DTSSQLStgFlag_Default = 0x0000,
// How to connect to the server.
DTSSQLStgFlag_UseTrustedConnection = 0x0100, // Use NT integrated security to connect to SQL Server
} DTS_ENUM_END(DTSSQLServerStorageFlags);
typedef DTS_ENUM_BEGIN(DTSRepositoryMetadataOptions, "Specifies metadata scanning and resolution options when storing the DTS Package to a Repository") {
DTSReposMetadata_Default = 0x0000, // Does no scanner resolution
// These indicate whether to attempt any scanner resolution at all. Note that scanning is only
// done at the Catalog level; an inconsistency at a lower level will be an error.
DTSReposMetadata_RequireScannedCatalog = 0x0001, // Requires that any database objects must have been scanned into repository
DTSReposMetadata_UseScannedCatalogIfPresent = 0x0002, // Will use any scanned objects found; nonscanned references will create local objects
// These are ignored unless one of the scanned-resolution options above is set.
// If neither of the _Scan options is set, then no scanning will be done;
// if _RequireAllScanned is set, the SaveToRepository will fail, otherwise
// a local reference will be created for the object.
DTSReposMetadata_ScanCatalogIfNotFound = 0x0004, // The Package will issue a scan on all catalogs that are not found already scanned
DTSReposMetadata_ScanCatalogAlways = 0x0008, // The Package will scan all Catalogs referenced, re-scanning if already scanned
} DTS_ENUM_END(DTSRepositoryMetadataOptions);
typedef DTS_ENUM_BEGIN(DTSSQLObjectType, "Indicates types of objects available on Microsoft SQL Server. This is in sync with SQLDMO_OBJECT_TYPE in SQL-DMO") {
// Database objects, value is power(2, sysobjects.sysstat & 0x0f), plus UDDTs in 0.
// These values can be bitmasked together for object listings.
DTSSQLObj_UserDefinedDatatype = 0x00000001, // 1
DTSSQLObj_SystemTable = 0x00000002, // 2
DTSSQLObj_View = 0x00000004, // 4
DTSSQLObj_UserTable = 0x00000008, // 8
DTSSQLObj_StoredProcedure = 0x00000010, // 16
DTSSQLObj_Default = 0x00000040, // 64
DTSSQLObj_Rule = 0x00000080, // 128
DTSSQLObj_Trigger = 0x00000100, // 256
DTSSQLObj_AllDatabaseUserObjects = 0x000001fd, // All but system tables
DTSSQLObj_AllDatabaseObjects = 0x000001ff, // All including system tables
} DTS_ENUM_END(DTSSQLObjectType);
typedef DTS_ENUM_BEGIN(DTSTransfer_CopyDataOption, "Specifies flags indicating if data should be copied, and whether existing data should be replaced or appended to.") {
DTSTransfer_DontCopyData = 0x0000,
DTSTransfer_ReplaceData = 0x0001,
DTSTransfer_AppendData = 0x0002,
} DTS_ENUM_END(DTSTransfer_CopyDataOption);
typedef DTS_ENUM_BEGIN(DTSTransfer_ScriptOption, "Specifies scripting option. This is in sync with SQLDMO_SCRIPT_TYPE in SQL-DMO.") {
// What's included in the Script method output.
DTSTransfer_Script_Default = 0x0004, // Object creation only
DTSTransfer_Script_Drops = 0x0001, // Include object drops
DTSTransfer_Script_ObjectPermissions = 0x0002, // Include object permissions
DTSTransfer_Script_PrimaryObject = 0x0004, // Include object creation
DTSTransfer_Script_ClusteredIndexes = 0x0008, // Include clustered index creation (table only)
DTSTransfer_Script_Triggers = 0x0010, // Include trigger creation (table only)
DTSTransfer_Script_DatabasePermissions = 0x0020, // Database (statement) permissions
DTSTransfer_Script_Permissions = 0x0022, // Both database and object permissions (for scripting users).
DTSTransfer_Script_ToFileOnly = 0x0040, // If not set, a string is returned (if file nonnull, both are done)
DTSTransfer_Script_Bindings = 0x0080, // Include rule/default bindings (table only)
DTSTransfer_Script_AppendToFile = 0x0100, // Append to output file if it already exists.
DTSTransfer_Script_NoDRI = 0x0200, // Do not include DRI (intended for use if targeting pre-6.0 server with scripts)
DTSTransfer_Script_UDDTsToBaseType = 0x0400, // Convert UserDefinedDatatypes to base type when creating columns (table only)
// 0x0800 available.
DTSTransfer_Script_IncludeIfNotExists = 0x1000, // Include "if not exists" on object creation.
DTSTransfer_Script_NonClusteredIndexes = 0x2000, // Include nonclustered index creation (table only)
DTSTransfer_Script_Indexes = 0x12008, // Include all index creation (table only)
DTSTransfer_Script_Aliases = 0x4000, // For users, script aliases
DTSTransfer_Script_NoCommandTerm = 0x8000, // Do not append "GO" to commands.
DTSTransfer_Script_DRIIndexes = 0x10000, // Script DRI-generated indexes as indexes if NoDRI is specified.
DTSTransfer_Script_IncludeHeaders = 0x20000, // Include descriptive header in individual object script output.
DTSTransfer_Script_OwnerQualify = 0x40000, // Owner-qualify DROP statements (and CREATE where possible).
DTSTransfer_Script_TimestampToBinary = 0x80000, // Convert timestamp columns to binary(8) (for replication, etc.).
DTSTransfer_Script_SortedData = 0x100000, // If the index or constraint was clustered, append sorted_data
DTSTransfer_Script_SortedDataReorg = 0x200000, // Same as DTSTransfer_Script_SortedData, but Reorg is used to preserve fillfactor.
DTSTransfer_Script_TransferDefault = 0x800670ff, // The default script type for Transfer. This is combination of following flags:
// DTSTransfer_Script_PrimaryObject | DTSTransfer_Script_Bindings | DTSTransfer_Script_ClusteredIndexes | DTSTransfer_Script_NonClusteredIndexes |
// DTSTransfer_Script_Triggers| DTSTransfer_Script_ToFileOnly|DTSTransfer_Script_Permissions| DTSTransfer_Script_IncludeHeaders|
// DTSTransfer_Script_Aliases|DTSTransfer_Script_IncludeIfNotExists|DTSTransfer_Script_OwnerQualify
// DRI-restrictive flags. These may be combined with PrimaryObject as desired.
// These are to be used to include or exclude specific DRI components, such
// as for multi-pass scripting.
DTSTransfer_Script_DRI_NonClustered = 0x00400000,
DTSTransfer_Script_DRI_Clustered = 0x00800000,
DTSTransfer_Script_DRI_Checks = 0x01000000,
DTSTransfer_Script_DRI_Defaults = 0x02000000,
DTSTransfer_Script_DRI_UniqueKeys = 0x04000000,
DTSTransfer_Script_DRI_ForeignKeys = 0x08000000,
DTSTransfer_Script_DRI_PrimaryKey = 0x10000000,
DTSTransfer_Script_DRI_AllKeys = 0x1c000000, // Bitmask of all key types (PK, FK, Unique).
DTSTransfer_Script_DRI_AllConstraints = 0x1f000000, // Bitmask of all constraint types (PK, FK, Unique, Check, Default).
DTSTransfer_Script_DRI_All = 0x1fc00000, // All the foregoing (specifying this and not PrimaryObject gets just DRI output).
DTSTransfer_Script_DRIWithNoCheck = 0x20000000, // Script DRI with nocheck (not included in _DRI_All).
DTSTransfer_Script_NoIdentity = 0x40000000, // Script with no IDENTITY attribute (e.g. for Replication).
DTSTransfer_Script_UseQuotedIdentifiers = 0x80000000, // Scripts with quoted identifiers. Also will cause Transfer to SET QUOTED_IDENTIFIER ON on the destination.
// !!! When scripting out from 7.0: StoreProcedure, View and Trigger carry their own QI and AnsiNulls setting
// (based on the setting when the original object was created), and this flag does not affect them anymore.
// At the end of these object scripting, they set QI to the setting according to this flag,
// and AnsiNulls to ON (ODBC default).
} DTS_ENUM_END(DTSTransfer_ScriptOption);
typedef DTS_ENUM_BEGIN(DTSTransfer_ScriptOptionEx, "Specifies extended scripting option. This is in sync with SQLDMO_SCRIPT2_TYPE in SQL-DMO.") {
// Optional Script parameter.
DTSTransfer_ScriptEx_TransferDefault = 0x1010, // Default
DTSTransfer_ScriptEx_AnsiPadding = 0x0001, // Explicitly SET ANSI PADDING on or off before the create table
DTSTransfer_ScriptEx_AnsiFile = 0x0002, // Generate ANSI output file
DTSTransfer_ScriptEx_UnicodeFile = 0x0004, // Generate UNICODE output file
DTSTransfer_ScriptEx_NonStop = 0x0008, // When error during script file generation, log error and continue.
// This is a special case for Convert(scptxfr70.exe), not a general purpose flag
// If client uses this flag to generate output files, they are running on their own risk
// This flag affects script out (and only the part used by Convert), it does not affect transfer in.
DTSTransfer_ScriptEx_NoFG = 0x0010, // Do not generate 'ON <filegroup>'. For Replication
DTSTransfer_ScriptEx_MarkTriggers = 0x0020, // Mark system triggers. For Replication single table script only.
DTSTransfer_ScriptEx_OnlyUserTriggers = 0x0040, // Only script user triggers. For Replication single table script only.
DTSTransfer_ScriptEx_EncryptPWD = 0x0080, // Script encrypted password for logins
DTSTransfer_ScriptEx_SeparateXPs = 0x0100, // Script XP to a separate file (Convert)
DTSTransfer_ScriptEx_NoWhatIfIndexes = 0x0200, // Do not script What-If indexes (default: script out)
// Following are SQLAgent related scripting flags
DTSTransfer_ScriptEx_AgentNotify = 0x0400, // Script Notification for SQLAgent alert object
DTSTransfer_ScriptEx_AgentAlertJob = 0x0800, // Include Job in Alert scripting
//FT-Indexing
DTSTransfer_ScriptEx_FullTextIndex = 0x1000, // Include full-text index scripting (table only)
} DTS_ENUM_END(DTSTransfer_ScriptOptionEx);
typedef DTS_ENUM_BEGIN(DTSBulkInsert_DataFileType, "Specifies the type of datafile used for BULK INSERT") {
DTSBulkInsert_DataFileType_Char = 0x0000,
DTSBulkInsert_DataFileType_Native = 0x0001,
DTSBulkInsert_DataFileType_WideChar = 0x0002,
DTSBulkInsert_DataFileType_WideNative = 0x0003,
} DTS_ENUM_END(DTSBulkInsert_DataFileType);
// These are not a bitmask; each implies all prior (lesser-numbered) ones.
typedef DTS_ENUM_BEGIN(DTSLineageOptions, "Specifies how Package Execution Lineage should be presented and recorded") {
DTSLineage_None = 0x0000, // Default
DTSLineage_AddLineageVariables = 0x0001,
DTSLineage_WriteToReposIfAvailable = 0x0002,
DTSLineage_WriteToReposRequired = 0x0003,
} DTS_ENUM_END(DTSLineageOptions);
// This is a bitmask.
typedef DTS_ENUM_BEGIN(DTSFastLoadOptions, "Options specific to PumpTask.UseFastLoad") {
DTSFastLoad_NoOptions = 0x0000,
DTSFastLoad_KeepNulls = 0x0001,
DTSFastLoad_CheckConstraints = 0x0002,
DTSFastLoad_TableLock = 0x0004,
DTSFastLoad_Default = 0x0002, // DTSFastLoad_CheckConstraints
} DTS_ENUM_END(DTSFastLoadOptions);
#endif // DTSPackage_CONSTANTS_
/////////////////////////////////////////////////////////////////////////////////////////
// Interface definitions.
/////////////////////////////////////////////////////////////////////////////////////////
#ifndef DTSPackage_ODL_ // Skip if in .odl file.
// Optional parameter definitions. For C explicit values will have to be specified,
// as indicated within the CPPDEFAULT() expansion.
//
// DTSPackage Parameter sequencing is as follows ("optional" in accordance with C++ usage):
// Nonoptional parameters
// Nonoptional Return value if any
// Optional additional parameters
// Optional return value, if any
//
#ifndef CPPDEFAULT
#ifdef __cplusplus
#define CPPDEFAULT(DefaultParamValue) DefaultParamValue
#else
#define CPPDEFAULT(DefaultParamValue)
#endif
#endif
// Define constants to document parameter usage.
#define DTS_IN
#define DTS_OUT
#define DTS_INOUT
#define DTS_RETVAL
///////////////////////////////////////////////////////////////////////////////////////
// Class definitions and typedefs
///////////////////////////////////////////////////////////////////////////////////////
#ifndef DTSPackage_INTERNAL
// Forward-define all interfaces.
#define DTS_FWD_DEFINE_INTERFACE(itf) \
interface IDTS##itf; \
typedef interface IDTS##itf * LPDTS##itf;
DTS_FWD_DEFINE_INTERFACE(StdObject)
// Repeat the IDispatch members because C doesn't provide inheritance.
#define DTSPackage_DISPATCH_BASE(itf) \
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; \
STDMETHOD_(ULONG,AddRef) (THIS) PURE; \
STDMETHOD_(ULONG,Release) (THIS) PURE; \
STDMETHOD(GetTypeInfoCount)(THIS_ UINT * pcTypeInfo) PURE; \
STDMETHOD(GetTypeInfo)(THIS_ UINT iTypeInfo, LCID lcid, ITypeInfo ** ppTI) PURE; \
STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, LPOLESTR * rgszNames, UINT cNames, \
LCID lcid, DISPID * rgdispid) PURE; \
STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, \
DISPPARAMS * pdispparams, LPVARIANT pvarResult, \
LPEXCEPINFO pexcepinfo, UINT * puArgErr) PURE;
// This is the base class for all DTSPackage OleAut objects. It is never instantiated by itself.
// The members are copied into all derived classes so that C clients can reference
// them, since the DECLARE_INTERFACE_ macro doesn't provide inheritance in C. The
// undef/def of INTERFACE is likewise required for C programmers.
#undef INTERFACE
#define INTERFACE IDTSStdObject
DECLARE_INTERFACE_(INTERFACE, IDispatch)
{
DTSPackage_DISPATCH_BASE(IDTSStdObject)
};
#endif // ndef DTSPackage_INTERNAL
/////////////////////////////////////////////////////////////////////////////////
// Define the DTSPackage GUIDGEN templates.
/////////////////////////////////////////////////////////////////////////////////
#define DEFINE_DTSPackage_GUID(name, lval) \
DEFINE_GUID(name, 0x##lval, 0xEB1C, 0x11CF, 0xAE, 0x6E, 0x0, 0xAA, 0x0, 0x4A, 0x34, 0xD5);
#define DEFINE_DTSPackage_DTSCatID(name, lval) \
DEFINE_GUID(name, 0x##lval, 0xA282, 0x11D1, 0xB7, 0xD9, 0x0, 0xC0, 0x4F, 0xB6, 0xEF, 0xD5);
/////////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -