sqldmo.h
来自「希望我上传的这些东西可以对搞编程的程序员有点小小的帮助!谢谢!」· C头文件 代码 · 共 1,323 行 · 第 1/5 页
H
1,323 行
SQLDMO_DTypeUChar = -8, // SQL_WCHAR
SQLDMO_DTypeUVarchar = -9, // SQL_WVARCHAR
SQLDMO_DTypeGUID = -11, // SQL_GUID
SQLDMO_DTypeNText = -10, // SQL_WLONGVARCHAR
} SQLDMO_QUERY_DATATYPE;
typedef SQLDMO_HELPID(SQLDMO_AUDIT_TYPE) enum {
SQLDMOAudit_None = 0,
SQLDMOAudit_Success = 1,
SQLDMOAudit_Failure = 2,
SQLDMOAudit_All = 3
} SQLDMO_AUDIT_TYPE;
typedef SQLDMO_HELPID(SQLDMO_SECURITY_TYPE) enum {
SQLDMOSecurity_Min = 0,
SQLDMOSecurity_Normal = 0,
SQLDMOSecurity_Integrated = 1,
SQLDMOSecurity_Mixed = 2,
SQLDMOSecurity_Max = 2
} SQLDMO_SECURITY_TYPE;
typedef SQLDMO_HELPID(SQLDMO_MEDIA_TYPE) enum {
SQLDMOMedia_Floppy = 1,
SQLDMOMedia_FixedDisk = 2,
SQLDMOMedia_Tape = 4,
SQLDMOMedia_CDROM = 8,
SQLDMOMedia_All = 15
} SQLDMO_MEDIA_TYPE;
typedef SQLDMO_HELPID(SQLDMO_PERFMON_TYPE) enum {
SQLDMOPerfmon_None = 1000, // No perfmon integration
SQLDMOPerfmon_MinSet = 0,
SQLDMOPerfmon_Continuous = 0,
SQLDMOPerfmon_OnDemand = 1,
SQLDMOPerfmon_MaxSet = 1
} SQLDMO_PERFMON_TYPE;
typedef SQLDMO_HELPID(SQLDMO_DBSTATUS_TYPE) enum {
SQLDMODBStat_Normal = 0x0000,
SQLDMODBStat_Loading = 0x0020, // isinload
SQLDMODBStat_Recovering = 0x00c0, // 0x40 | 0x080, isinrecovery, isnotrecovered
SQLDMODBStat_Suspect = 0x0100, // issuspect, isshutdown (IsSuspect for recovery failure, IsShutdown for missing files)
SQLDMODBStat_Offline = 0x0200, // isoffline, isdetached
SQLDMODBStat_Inaccessible = 0x03e0, // Loading | Recovering | Suspect | Offline
SQLDMODBStat_EmergencyMode = 0x8000, // isemergencymode
SQLDMODBStat_Standby = 0x0400, // online as readonly, with restore log allowed
SQLDMODBStat_All = 0x87e0
} SQLDMO_DBSTATUS_TYPE;
typedef SQLDMO_HELPID(SQLDMO_COPYDATA_TYPE) enum {
SQLDMOCopyData_False = 0,
SQLDMOCopyData_Replace = 1,
SQLDMOCopyData_Append = 2
} SQLDMO_COPYDATA_TYPE;
typedef SQLDMO_HELPID(SQLDMO_DATAFILE_TYPE) enum {
// Bulk-copy datafile options (Table/View.Export and Table.Import). These are mutually exclusive.
SQLDMODataFile_CommaDelimitedChar = 0x00000001, // ColumnDelimiter == Comma, RowDelimiter == <CRLF>
SQLDMODataFile_Default = 0x00000001, // Default == csv
SQLDMODataFile_TabDelimitedChar = 0x00000002, // ColumnDelimiter == <TAB>, RowDelimiter == <CRLF>
SQLDMODataFile_SpecialDelimitedChar = 0x00000003, // Set BulkCopy.ColumnDelimiter and .RowDelimiter
SQLDMODataFile_NativeFormat = 0x00000004, // Use native datatype formats
SQLDMODataFile_UseFormatFile = 0x00000005, // Use an existing format file.
} SQLDMO_DATAFILE_TYPE;
typedef SQLDMO_HELPID(SQLDMO_STATUSINFO_TYPE) enum {
SQLDMOStatInfo_Unknown = 0, // Initialization value, not valid as a parameter
SQLDMOStatInfo_DatabaseStatus = 0x0001, // Database.Status
SQLDMOStatInfo_DatabaseSpace = 0x0002, // Database.SpaceAvailable
SQLDMOStatInfo_AutoVerifyConnection = 0x0004, // Server.VerifyConnection done automatically.
SQLDMOStatInfo_All = 0x0007 // All the foregoing
} SQLDMO_STATUSINFO_TYPE;
typedef SQLDMO_HELPID(SQLDMO_SCRIPT_TYPE) enum {
// What's included in the Script method output.
SQLDMOScript_Default = 0x0004, // Object creation only
SQLDMOScript_Drops = 0x0001, // Include object drops
SQLDMOScript_ObjectPermissions = 0x0002, // Include object permissions
SQLDMOScript_PrimaryObject = 0x0004, // Include object creation
SQLDMOScript_ClusteredIndexes = 0x0008, // Include clustered index creation (table only)
SQLDMOScript_Triggers = 0x0010, // Include trigger creation (table only)
SQLDMOScript_DatabasePermissions = 0x0020, // Database (statement) permissions
SQLDMOScript_Permissions = 0x0022, // Both database and object permissions (for scripting users).
SQLDMOScript_ToFileOnly = 0x0040, // If not set, a string is returned (if file nonnull, both are done)
SQLDMOScript_Bindings = 0x0080, // Include rule/default bindings (table only)
SQLDMOScript_AppendToFile = 0x0100, // Append to output file if it already exists.
SQLDMOScript_NoDRI = 0x0200, // Do not include DRI (intended for use if targeting pre-6.0 server with scripts)
SQLDMOScript_UDDTsToBaseType = 0x0400, // Convert UserDefinedDatatypes to base type when creating columns (table only)
// 0x0800 available.
SQLDMOScript_IncludeIfNotExists = 0x1000, // Include "if not exists" on object creation.
SQLDMOScript_NonClusteredIndexes = 0x2000, // Include nonclustered index creation (table only)
SQLDMOScript_Indexes = 0x12008, // Include all index creation (table only)
SQLDMOScript_Aliases = 0x4000, // For users, script aliases
SQLDMOScript_NoCommandTerm = 0x8000, // Do not append "GO" to commands.
SQLDMOScript_DRIIndexes = 0x10000, // Script DRI-generated indexes as indexes if NoDRI is specified.
SQLDMOScript_IncludeHeaders = 0x20000, // Include descriptive header in individual object script output.
SQLDMOScript_OwnerQualify = 0x40000, // Owner-qualify DROP statements (and CREATE where possible).
SQLDMOScript_TimestampToBinary = 0x80000, // Convert timestamp columns to binary(8) (for replication, etc.).
SQLDMOScript_SortedData = 0x100000, // If the index or constraint was clustered, append sorted_data
SQLDMOScript_SortedDataReorg = 0x200000, // Same as SQLDMOScript_SortedData, but Reorg is used to preserve fillfactor.
SQLDMOScript_TransferDefault = 0x670ff, // The default script type for Transfer. This is combination of following flags:
// SQLDMOScript_PrimaryObject | SQLDMOScript_Bindings | SQLDMOScript_ClusteredIndexes | SQLDMOScript_NonClusteredIndexes |
// SQLDMOScript_Triggers| SQLDMOScript_ToFileOnly|SQLDMOScript_Permissions| SQLDMOScript_IncludeHeaders|
// SQLDMOScript_Aliases|SQLDMOScript_IncludeIfNotExists|SQLDMOScript_OwnerQualify|SQLDMOScript_Drops
// 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.
SQLDMOScript_DRI_NonClustered = 0x00400000,
SQLDMOScript_DRI_Clustered = 0x00800000,
SQLDMOScript_DRI_Checks = 0x01000000,
SQLDMOScript_DRI_Defaults = 0x02000000,
SQLDMOScript_DRI_UniqueKeys = 0x04000000,
SQLDMOScript_DRI_ForeignKeys = 0x08000000,
SQLDMOScript_DRI_PrimaryKey = 0x10000000,
SQLDMOScript_DRI_AllKeys = 0x1c000000, // Bitmask of all key types (PK, FK, Unique).
SQLDMOScript_DRI_AllConstraints = 0x1f000000, // Bitmask of all constraint types (PK, FK, Unique, Check, Default).
SQLDMOScript_DRI_All = 0x1fc00000, // All the foregoing (specifying this and not PrimaryObject gets just DRI output).
SQLDMOScript_DRIWithNoCheck = 0x20000000, // Script DRI with nocheck (not included in _DRI_All).
SQLDMOScript_NoIdentity = 0x40000000, // Script with no IDENTITY attribute (e.g. for Replication).
SQLDMOScript_UseQuotedIdentifiers = 0x80000000, // Scripts with quoted identifiers. Also will cause Transfer to SET QUOTED_IDENTIFIER ON on the destination.
// !!! This is a backward compatible flag, when scripting from post 6.5 server, this flag would be igored.
// !!! 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).
} SQLDMO_SCRIPT_TYPE;
typedef SQLDMO_HELPID(SQLDMO_SCRIPT2_TYPE) enum {
// Optional Script parameter.
SQLDMOScript2_Default = 0x0000, // Default
SQLDMOScript2_AnsiPadding = 0x0001, // Explicitly SET ANSI PADDING on or off before the create table
SQLDMOScript2_AnsiFile = 0x0002, // Generate ANSI output file
SQLDMOScript2_UnicodeFile = 0x0004, // Generate UNICODE output file
SQLDMOScript2_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.
SQLDMOScript2_NoFG = 0x0010, // Do not generate 'ON <filegroup>'. For Replication
SQLDMOScript2_MarkTriggers = 0x0020, // Mark system triggers. For Replication single table script only.
SQLDMOScript2_OnlyUserTriggers = 0x0040, // Only script user triggers. For Replication single table script only.
SQLDMOScript2_EncryptPWD = 0x0080, // Script encrypted password for logins
SQLDMOScript2_SeparateXPs = 0x0100, // Script XP to a separate file (Convert)
SQLDMOScript2_NoWhatIfIndexes = 0x0200, // Do not script What-If indexes (default: script out)
// Following are SQLAgent related scripting flags
SQLDMOScript2_AgentNotify = 0x0400, // Script Notification for SQLAgent alert object
SQLDMOScript2_AgentAlertJob = 0x0800, // Include Job in Alert scripting
// Monarch full-text flag
SQLDMOScript2_FullTextIndex = 0x80000, // Include full-text index scripting (table only)
SQLDMOScript2_LoginSID = 0x100000, // Include the SID for standard SQLServer logins
SQLDMOScript2_FullTextCat = 0x200000, // Include full-text catelog scripting
} SQLDMO_SCRIPT2_TYPE;
typedef SQLDMO_HELPID(SQLDMO_XFRSCRIPTMODE_TYPE) enum {
// How many files the XFR Script is to written to.
SQLDMOXfrFile_Default = 0x0001, // Default to summary files
SQLDMOXfrFile_SummaryFiles = 0x0001, // One files per class of objects transferred/dropped
SQLDMOXfrFile_SingleFile = 0x0002, // All scripts go to same file
SQLDMOXfrFile_SingleFilePerObject = 0x0004, // One file per object
SQLDMOXfrFile_SingleSummaryFile = 0x0008, // One file with summary file format
} SQLDMO_XFRSCRIPTMODE_TYPE;
typedef SQLDMO_HELPID(SQLDMO_DEPENDENCY_TYPE) enum {
SQLDMODep_Parents = 0, // Default: return all parents of input object
SQLDMODep_FullHierarchy = 0x10000, // Return full hierarchy; multiple rows of object and parents/children
SQLDMODep_OrderDescending = 0x20000, // Order return in descending order
SQLDMODep_Children = 0x40000, // Return children of input object
SQLDMODep_ReturnInputObject = 0x80000, // Include input object in the return set
SQLDMODep_FirstLevelOnly = 0x100000, // Return only immediate parents/children
SQLDMODep_DRIOnly = 0x200000, // Return DRI dependencies only.
SQLDMODep_Valid = 0x3f0000 // All valid options.
} SQLDMO_DEPENDENCY_TYPE;
typedef SQLDMO_HELPID(SQLDMO_OBJSORT_TYPE) enum {
SQLDMOObjSort_Name = 0,
SQLDMOObjSort_Type = 1,
SQLDMOObjSort_Owner = 2,
SQLDMOObjSort_Date = 3
} SQLDMO_OBJSORT_TYPE;
typedef SQLDMO_HELPID(SQLDMO_SVCSTATUS_TYPE) enum {
SQLDMOSvc_Unknown = 0,
SQLDMOSvc_Running = 1,
SQLDMOSvc_Paused = 2,
SQLDMOSvc_Stopped = 3,
SQLDMOSvc_Starting = 4,
SQLDMOSvc_Stopping = 5,
SQLDMOSvc_Continuing = 6,
SQLDMOSvc_Pausing = 7
} SQLDMO_SVCSTATUS_TYPE;
typedef SQLDMO_HELPID(SQLDMO_SRVOPTION_TYPE) enum {
SQLDMOSrvOpt_Unknown = 0x0000,
SQLDMOSrvOpt_RPC = 0x0001, // For both remote and linked server, through sp_serveroption
SQLDMOSrvOpt_Publisher = 0x0002,
SQLDMOSrvOpt_Subscriber = 0x0004,
SQLDMOSrvOpt_Distributor = 0x0008,
SQLDMOSrvOpt_DistPublisher = 0x0010, // Separate from Publisher and Distributor; dpub bit set
// SQLDMOSrvOpt_ODBCDatasource = 0x0020, // Server is an ODBC datasource
// SQLDMOSrvOpt_Valid = 0x0021, // Only valid to set the RPC and ODBCDataSource options
// Following are new linked server options
SQLDMOSrvOpt_RPC_out = 0x0040, // Through sp_serveroption
SQLDMOSrvOpt_DataAccess = 0x0080, // Through sp_serveroption
SQLDMOSrvOpt_CollationCompatible = 0x0100, // Through sp_serveroption
SQLDMOSrvOpt_NonTransacted = 0x0200, // Through registry
SQLDMOSrvOpt_InProcess = 0x0400, // Through registry
SQLDMOSrvOpt_IndexAsAccessPath = 0x0800, // Through registry
SQLDMOSrvOpt_LevelZeroOnly = 0x1000, // Through registry
SQLDMOSrvOpt_NestedQueries = 0x2000, // Through registry
SQLDMOSrvOpt_DynamicParameters = 0x4000, // Through registry
} SQLDMO_SRVOPTION_TYPE;
typedef SQLDMO_HELPID(SQLDMO_TABLEATT_TYPE) enum {
// Values from sysobjects.category.
SQLDMOTabAtt_Identity = 0x0001, // Table has an identity column
SQLDMOTabAtt_SystemObject = 0x0002, // Table is a Microsoft system-required object
SQLDMOTabAtt_ForeignKey = 0x0004, // Table has a foreign key
SQLDMOTabAtt_Referenced = 0x0008, // Table is referenced by another table's foreign key
SQLDMOTabAtt_Published = 0x0020, // Table is published
SQLDMOTabAtt_Replicated = 0x0040, // Table has an active subscriber
SQLDMOTabAtt_Check = 0x0080, // Table has a check constraint
SQLDMOTabAtt_Replica = 0x0100, // Table is actively subscribed to a publisher
SQLDMOTabAtt_PrimaryKey = 0x0200, // Table has a primary key
SQLDMOTabAtt_Unique = 0x0400, // Table has a unique constraint
SQLDMOTabAtt_Default = 0x0800, // Table has a DRI default
SQLDMOTabAtt_ReplCheck = 0x1000, // Table has a check constraint that excludes replication
SQLDMOTabAtt_HasConstraint =0x1c84 // Table has at least one DRI constraint
} SQLDMO_TABLEATT_TYPE;
typedef SQLDMO_HELPID(SQLDMO_INTSECLOGIN_TYPE) enum {
SQLDMOIntSecLogin_Unknown = 0,
SQLDMOIntSecLogin_Min = 1,
SQLDMOIntSecLogin_Admin = 1,
SQLDMOIntSecLogin_User = 2,
SQLDMOIntSecLogin_Replication = 3,
SQLDMOIntSecLogin_Max = 3
} SQLDMO_INTSECLOGIN_TYPE;
typedef SQLDMO_HELPID(SQLDMO_VERIFYCONN_TYPE) enum {
SQLDMOConn_LastState = 0x0001, // State of conn at end of last operation.
SQLDMOConn_CurrentState = 0x0002, // Actual current state (checks pipe, etc.)
SQLDMOConn_ReconnectIfDead = 0x0006, // Reconnect if we've been disconnected (0x0004 | CurrentState)..
SQLDMOConn_Valid = 0x0007 // All valid conn operations.
} SQLDMO_VERIFYCONN_TYPE;
typedef SQLDMO_HELPID(SQLDMO_EXEC_TYPE) enum {
// For ExecuteImmediate, tells how to handle multi-batch commands.
SQLDMOExec_Default = 0x0000, // None of the following
SQLDMOExec_NoCommandTerm = 0x0001, // No command-terminator parsing (i.e. don't check for "GO"; exec as single batch)
SQLDMOExec_ContinueOnError = 0x0002, // Continue batch on all but broken-connection errors.
SQLDMOExec_NoExec = 0x0004, // SET NOEXEC ON/OFF
SQLDMOExec_ParseOnly = 0x0008, // SET PARSEONLY ON/OFF
SQLDMOExec_QI_ON = 0x0010 // SET QI ON before execution, special work around for Quoted Identifier, set QI OFF before return
} SQLDMO_EXEC_TYPE;
typedef SQLDMO_HELPID(SQLDMO_CONFIGVALUE_TYPE) enum {
SQLDMOConfig_RecoveryInterval = 101,
SQLDMOConfig_AllowUpdates = 102,
SQLDMOConfig_UserConnections = 103,
SQLDMOConfig_Locks = 106,
SQLDMOConfig_OpenObjects = 107,
SQLDMOConfig_FillFactor = 109,
SQLDMOConfig_NestedTriggers = 115,
SQLDMOConfig_RemoteAccess = 117,
SQLDMOConfig_DefaultLanguage = 124,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?