7f9efe37d1d7c4311b880dc7c09f6db836a4d06e
[mono.git] / mcs / class / referencesource / System.Data / System / Data / SqlClient / TdsEnums.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="TdsEnums.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 // <owner current="true" primary="false">Microsoft</owner>
7 //------------------------------------------------------------------------------
8
9 namespace System.Data.SqlClient {
10     using System;
11     using System.Diagnostics;
12
13     /// <devdoc> Class of variables for the Tds connection.
14     /// </devdoc>
15     internal static class TdsEnums {
16
17         // internal tdsparser constants
18
19         public const short SQL_SERVER_VERSION_SEVEN = 7;
20
21         public const string SQL_PROVIDER_NAME = Common.DbConnectionStringDefaults.ApplicationName;
22
23         public static readonly Decimal SQL_SMALL_MONEY_MIN = new Decimal(-214748.3648);
24         public static readonly Decimal SQL_SMALL_MONEY_MAX = new Decimal(214748.3647);
25
26         // sql debugging constants, sdci is the structure passed in
27         public const string SDCI_MAPFILENAME = "SqlClientSSDebug";
28         public const byte SDCI_MAX_MACHINENAME = 32;
29         public const byte SDCI_MAX_DLLNAME = 16;
30         public const byte SDCI_MAX_DATA = 255;
31         public const int SQLDEBUG_OFF = 0;
32         public const int SQLDEBUG_ON = 1;
33         public const int SQLDEBUG_CONTEXT = 2;
34         public const string SP_SDIDEBUG = "sp_sdidebug";
35         public static readonly string[] SQLDEBUG_MODE_NAMES = new string[3] {
36             "off",
37             "on",
38             "context"
39         };
40
41         // HACK!!!
42         // Constant for SqlDbType.SmallVarBinary... store internal variable here instead of on
43         // SqlDbType so that it is not surfaced to the user!!!  Related to dtc and the fact that
44         // the TransactionManager TDS stream is the only token left that uses VarBinarys instead of
45         // BigVarBinarys.
46         public const SqlDbType SmallVarBinary = (SqlDbType) (SqlDbType.Variant)+1;
47
48         // network protocol string constants
49         public const string TCP  = "tcp";
50         public const string NP   = "np";
51         public const string RPC  = "rpc";
52         public const string BV   = "bv";
53         public const string ADSP = "adsp";
54         public const string SPX  = "spx";
55         public const string VIA  = "via";
56         public const string LPC  = "lpc";
57
58         // network function string contants
59         public const string INIT_SSPI_PACKAGE       = "InitSSPIPackage";
60         public const string INIT_ADAL_PACKAGE       = "InitADALPackage";
61         public const string INIT_SESSION            = "InitSession";
62         public const string CONNECTION_GET_SVR_USER = "ConnectionGetSvrUser";
63         public const string GEN_CLIENT_CONTEXT      = "GenClientContext";
64
65         // tdsparser packet handling constants
66         public const byte SOFTFLUSH = 0;
67         public const byte HARDFLUSH = 1;
68         public const byte IGNORE = 2;
69
70         // header constants
71         public const int HEADER_LEN = 8;
72         public const int HEADER_LEN_FIELD_OFFSET = 2;
73         public const int YUKON_HEADER_LEN = 12; //Yukon headers also include a MARS session id
74         public const int MARS_ID_OFFSET = 8;
75         public const int HEADERTYPE_QNOTIFICATION = 1;
76         public const int HEADERTYPE_MARS = 2;
77         public const int HEADERTYPE_TRACE = 3;
78
79         // other various constants
80         public const int   SUCCEED                     = 1;
81         public const int   FAIL                        = 0;
82         public const short TYPE_SIZE_LIMIT             = 8000;
83         public const int   MIN_PACKET_SIZE             = 512;
84         // Login packet can be no greater than 4k until server sends us env-change
85         // increasing packet size.
86         public const int   DEFAULT_LOGIN_PACKET_SIZE   = 4096;
87         public const int   MAX_PRELOGIN_PAYLOAD_LENGTH = 1024;
88         public const int   MAX_PACKET_SIZE             = 32768;
89         public const int   MAX_SERVER_USER_NAME        = 256;  // obtained from luxor
90
91         // Severity  0 - 10 indicates informational (non-error) messages
92         // Severity 11 - 16 indicates errors that can be corrected by user (syntax errors, etc...)
93         // Severity 17 - 19 indicates failure due to insufficient resources in the server
94         //      (max locks exceeded, not enough memory, other internal server limits reached, etc..)
95         // Severity 20 - 25 Severe problems with the server, connection terminated.
96         public const byte  MIN_ERROR_CLASS                  = 11;   // webdata 100667: This should actually be 11
97         public const byte  MAX_USER_CORRECTABLE_ERROR_CLASS = 16;
98         public const byte  FATAL_ERROR_CLASS                = 20;
99
100         //    Message types
101         public const byte MT_SQL      = 1;    // SQL command batch
102         public const byte MT_LOGIN    = 2;    // Login message for pre-Sphinx (before version 7.0)
103         public const byte MT_RPC      = 3;    // Remote procedure call
104         public const byte MT_TOKENS   = 4;    // Table response data stream
105         public const byte MT_BINARY   = 5;    // Unformatted binary response data (UNUSED)
106         public const byte MT_ATTN     = 6;    // Attention (break) signal
107         public const byte MT_BULK     = 7;    // Bulk load data
108         public const byte MT_FEDAUTH  = 8;    // Authentication token for federated authentication
109         public const byte MT_CLOSE    = 9;    // Close subchannel   (UNUSED)
110         public const byte MT_ERROR    = 10;   // Protocol error detected
111         public const byte MT_ACK      = 11;   // Protocol acknowledgement   (UNUSED)
112         public const byte MT_ECHO     = 12;   // Echo data  (UNUSED)
113         public const byte MT_LOGOUT   = 13;   // Logout message (UNUSED)
114         public const byte MT_TRANS    = 14;   // Transaction Manager Interface
115         public const byte MT_OLEDB    = 15;   // ? (UNUSED)
116         public const byte MT_LOGIN7   = 16;   // Login message for Sphinx (version 7) or later
117         public const byte MT_SSPI     = 17;   // SSPI message
118         public const byte MT_PRELOGIN = 18;   // Pre-login handshake
119
120         // Message status bits
121         public const byte ST_EOM              = 0x1; // Packet is end-of-message
122         public const byte ST_AACK             = 0x2; // Packet acknowledges attention (server to client)
123         public const byte ST_IGNORE           = 0x2; // Ignore this event (client to server)
124         public const byte ST_BATCH            = 0x4; // Message is part of a batch.
125         public const byte ST_RESET_CONNECTION = 0x8; // Exec sp_reset_connection prior to processing message
126         public const byte ST_RESET_CONNECTION_PRESERVE_TRANSACTION = 0x10;  // reset prior to processing, with preserving local tx
127
128         // TDS control tokens
129         public const byte SQLCOLFMT       = 0xa1;
130         public const byte SQLPROCID       = 0x7c;
131         public const byte SQLCOLNAME      = 0xa0;
132         public const byte SQLTABNAME      = 0xa4;
133         public const byte SQLCOLINFO      = 0xa5;
134         public const byte SQLALTNAME      = 0xa7;
135         public const byte SQLALTFMT       = 0xa8;
136         public const byte SQLERROR        = 0xaa;
137         public const byte SQLINFO         = 0xab;
138         public const byte SQLRETURNVALUE  = 0xac;
139         public const byte SQLRETURNSTATUS = 0x79;
140         public const byte SQLRETURNTOK    = 0xdb;
141         public const byte SQLALTCONTROL   = 0xaf;
142         public const byte SQLROW          = 0xd1;
143         public const byte SQLNBCROW       = 0xd2;    // same as ROW with null-bit-compression support
144         public const byte SQLALTROW       = 0xd3;
145         public const byte SQLDONE         = 0xfd;
146         public const byte SQLDONEPROC     = 0xfe;
147         public const byte SQLDONEINPROC   = 0xff;
148         public const byte SQLOFFSET       = 0x78;
149         public const byte SQLORDER        = 0xa9;
150         public const byte SQLDEBUG_CMD    = 0x60;
151         public const byte SQLLOGINACK     = 0xad;
152         public const byte SQLFEATUREEXTACK= 0xae;    // TDS 7.4 - feature ack
153         public const byte SQLSESSIONSTATE = 0xe4;    // TDS 7.4 - connection resiliency session state  
154         public const byte SQLENVCHANGE    = 0xe3;    // Environment change notification
155         public const byte SQLSECLEVEL     = 0xed;    // Security level token ???
156         public const byte SQLROWCRC       = 0x39;    // ROWCRC datastream???
157         public const byte SQLCOLMETADATA  = 0x81;    // Column metadata including name
158         public const byte SQLALTMETADATA  = 0x88;    // Alt column metadata including name
159         public const byte SQLSSPI         = 0xed;    // SSPI data
160         public const byte SQLFEDAUTHINFO  = 0xee;    // Info for client to generate fed auth token
161
162         // Environment change notification streams
163         // TYPE on TDS ENVCHANGE token stream (from sql\ntdbms\include\odsapi.h)
164         //
165         public const byte ENV_DATABASE                  = 1;  // Database changed
166         public const byte ENV_LANG                      = 2;  // Language changed
167         public const byte ENV_CHARSET                   = 3;  // Character set changed
168         public const byte ENV_PACKETSIZE                = 4;  // Packet size changed
169         public const byte ENV_LOCALEID                  = 5;  // Unicode data sorting locale id
170         public const byte ENV_COMPFLAGS                 = 6;  // Unicode data sorting comparison flags
171         public const byte ENV_COLLATION                 = 7;  // SQL Collation
172         // The following are environment change tokens valid for Yukon or later.
173         public const byte ENV_BEGINTRAN                 = 8;  // Transaction began
174         public const byte ENV_COMMITTRAN                = 9;  // Transaction committed
175         public const byte ENV_ROLLBACKTRAN              = 10; // Transaction rolled back
176         public const byte ENV_ENLISTDTC                 = 11; // Enlisted in Distributed Transaction
177         public const byte ENV_DEFECTDTC                 = 12; // Defected from Distributed Transaction
178         public const byte ENV_LOGSHIPNODE               = 13; // Realtime Log shipping primary node
179         public const byte ENV_PROMOTETRANSACTION        = 15; // Promote Transaction
180         public const byte ENV_TRANSACTIONMANAGERADDRESS = 16; // Transaction Manager Address
181         public const byte ENV_TRANSACTIONENDED          = 17; // Transaction Ended
182         public const byte ENV_SPRESETCONNECTIONACK      = 18; // SP_Reset_Connection ack
183         public const byte ENV_USERINSTANCE              = 19; // User Instance
184         public const byte ENV_ROUTING                   = 20; // Routing (ROR) information
185
186         // done status stream bit masks
187         public const int DONE_MORE       = 0x0001; // more command results coming
188         public const int DONE_ERROR      = 0x0002; // error in command batch
189         public const int DONE_INXACT     = 0x0004; // transaction in progress
190         public const int DONE_PROC       = 0x0008; // done from stored proc
191         public const int DONE_COUNT      = 0x0010; // count in done info
192         public const int DONE_ATTN       = 0x0020; // oob ack
193         public const int DONE_INPROC     = 0x0040; // like DONE_PROC except proc had error
194         public const int DONE_RPCINBATCH = 0x0080; // Done from RPC in batch
195         public const int DONE_SRVERROR   = 0x0100; // Severe error in which resultset should be discarded
196         public const int DONE_FMTSENT    = 0x8000; // fmt message sent, done_inproc req'd
197
198         // Feature Extension
199         public const byte FEATUREEXT_TERMINATOR = 0xFF;
200         public const byte FEATUREEXT_SRECOVERY  = 0x01;
201         public const byte FEATUREEXT_FEDAUTH    = 0x02;
202         public const byte FEATUREEXT_TCE        = 0x04;
203
204         [Flags]
205         public enum FeatureExtension:uint {
206             None=0,
207             SessionRecovery=1,
208             FedAuth=2,
209             Tce=4,
210         }
211
212         public const byte FEDAUTHLIB_LIVEID        = 0X00;
213         public const byte FEDAUTHLIB_SECURITYTOKEN = 0x01;
214         public const byte FEDAUTHLIB_ADAL          = 0x02;
215         public const byte FEDAUTHLIB_RESERVED      = 0X7F;
216
217         public enum FedAuthLibrary:byte {
218             LiveId=FEDAUTHLIB_LIVEID,
219             SecurityToken=FEDAUTHLIB_SECURITYTOKEN,
220             ADAL=FEDAUTHLIB_ADAL,
221             Default=FEDAUTHLIB_RESERVED
222         }
223
224         public const byte ADALWORKFLOW_ACTIVEDIRECTORYPASSWORD = 0x01;
225         public const byte ADALWORKFLOW_ACTIVEDIRECTORYINTEGRATED = 0x02;
226
227         public enum ActiveDirectoryWorkflow : byte {
228             Password=ADALWORKFLOW_ACTIVEDIRECTORYPASSWORD,
229             Integrated=ADALWORKFLOW_ACTIVEDIRECTORYINTEGRATED,
230         }
231
232         // The string used for username in the error message when Authentication = Active Directory Integrated with FedAuth is used, if authentication fails.
233         public const string NTAUTHORITYANONYMOUSLOGON = @"NT Authority\Anonymous Logon";
234
235         //    Loginrec defines
236         public const byte   MAX_LOG_NAME       = 30;              // TDS 4.2 login rec max name length
237         public const byte   MAX_PROG_NAME      = 10;              // max length of loginrec progran name
238         public const byte   SEC_COMP_LEN       = 8;               // length of security compartments
239         public const byte   MAX_PK_LEN         = 6;               // max length of TDS packet size
240         public const byte   MAX_NIC_SIZE       = 6;               // The size of a MAC or client address
241         public const byte   SQLVARIANT_SIZE    = 2;               // size of the fixed portion of a sql variant (type, cbPropBytes)
242         public const byte   VERSION_SIZE       = 4;               // size of the tds version (4 unsigned bytes)
243         public const int    CLIENT_PROG_VER    = 0x06000000;      // Client interface version       
244         public const int    YUKON_LOG_REC_FIXED_LEN  = 0x5e;
245         // misc
246         public const int    TEXT_TIME_STAMP_LEN = 8;
247         public const int    COLLATION_INFO_LEN = 4;
248
249 /*
250         public const byte INT4_LSB_HI   = 0;     // lsb is low byte (eg 68000)
251         //    public const byte INT4_LSB_LO   = 1;     // lsb is low byte (eg VAX)
252         public const byte INT2_LSB_HI   = 2;     // lsb is low byte (eg 68000)
253         //    public const byte INT2_LSB_LO   = 3;     // lsb is low byte (eg VAX)
254         public const byte FLT_IEEE_HI   = 4;     // lsb is low byte (eg 68000)
255         public const byte CHAR_ASCII    = 6;     // ASCII character set
256         public const byte TWO_I4_LSB_HI = 8;     // lsb is low byte (eg 68000
257         //    public const byte TWO_I4_LSB_LO = 9;     // lsb is low byte (eg VAX)
258         //    public const byte FLT_IEEE_LO   = 10;    // lsb is low byte (eg MSDOS)
259         public const byte FLT4_IEEE_HI  = 12;    // IEEE 4-byte floating point -lsb is high byte
260         //    public const byte FLT4_IEEE_LO  = 13;    // IEEE 4-byte floating point -lsb is low byte
261         public const byte TWO_I2_LSB_HI = 16;    // lsb is high byte
262         //    public const byte TWO_I2_LSB_LO = 17;    // lsb is low byte
263
264         public const byte LDEFSQL     = 0;    // server sends its default
265         public const byte LDEFUSER    = 0;    // regular old user
266         public const byte LINTEGRATED = 8;    // integrated security login
267 */
268
269         /* Versioning scheme table:
270
271             Client sends:
272             0x70000000 -> Sphinx
273             0x71000000 -> Shiloh RTM
274             0x71000001 -> Shiloh SP1
275             0x72xx0002 -> Yukon RTM
276
277             Server responds:
278             0x07000000 -> Sphinx     // Notice server response format is different for bwd compat
279             0x07010000 -> Shiloh RTM // Notice server response format is different for bwd compat
280             0x71000001 -> Shiloh SP1
281             0x72xx0002 -> Yukon RTM
282         */
283
284         // Pre Shiloh SP1 versioning scheme:
285         public const int SPHINXORSHILOH_MAJOR = 0x07;     // The high byte (b3) is not sufficient to distinguish
286         public const int SPHINX_INCREMENT     = 0x00;     // Sphinx and Shiloh
287         public const int SHILOH_INCREMENT     = 0x01;     // So we need to look at the high-mid byte (b2) as well
288         public const int DEFAULT_MINOR        = 0x0000;
289
290         // Shiloh SP1 and beyond versioning scheme:
291
292         // Majors:
293         public const int SHILOHSP1_MAJOR      = 0x71;     // For Shiloh SP1 and later the versioning schema changed and
294         public const int YUKON_MAJOR          = 0x72;     // the high-byte is sufficient to distinguish later versions
295         public const int KATMAI_MAJOR         = 0x73;
296         public const int DENALI_MAJOR         = 0x74;
297
298         // Increments:
299         public const int SHILOHSP1_INCREMENT  = 0x00;
300         public const int YUKON_INCREMENT      = 0x09;
301         public const int KATMAI_INCREMENT     = 0x0b;
302         public const int DENALI_INCREMENT     = 0x00;
303
304         // Minors:
305         public const int SHILOHSP1_MINOR      = 0x0001;
306         public const int YUKON_RTM_MINOR      = 0x0002;
307         public const int KATMAI_MINOR         = 0x0003;
308         public const int DENALI_MINOR         = 0x0004;
309
310         public const int ORDER_68000     = 1;
311         public const int USE_DB_ON       = 1;
312         public const int INIT_DB_FATAL   = 1;
313         public const int SET_LANG_ON     = 1;
314         public const int INIT_LANG_FATAL = 1;
315         public const int ODBC_ON         = 1;
316         public const int SSPI_ON         = 1;
317         public const int REPL_ON         = 3;
318
319
320         // send the read-only intent to the server
321         public const int READONLY_INTENT_ON = 1;
322
323         // Token masks
324         public const byte SQLLenMask  = 0x30;    // mask to check for length tokens
325         public const byte SQLFixedLen = 0x30;    // Mask to check for fixed token
326         public const byte SQLVarLen   = 0x20;    // Value to check for variable length token
327         public const byte SQLZeroLen  = 0x10;    // Value to check for zero length token
328         public const byte SQLVarCnt   = 0x00;    // Value to check for variable count token
329
330         // Token masks for COLINFO status
331         public const byte SQLDifferentName = 0x20; // column name different than select list name
332         public const byte SQLExpression = 0x4;     // column was result of an expression
333         public const byte SQLKey = 0x8;            // column is part of the key for the table
334         public const byte SQLHidden = 0x10;        // column not part of select list but added because part of key
335
336         // Token masks for COLMETADATA flags
337         //   first byte
338         public const byte Nullable = 0x1;
339         public const byte Identity = 0x10;
340         public const byte Updatability = 0xb;   // mask off bits 3 and 4
341         //   second byte
342         public const byte ClrFixedLen = 0x1;    // Fixed length CLR type
343         public const byte IsColumnSet = 0x4;    // Column is an XML representation of an aggregation of other columns
344         public const byte IsEncrypted = 0x8;    // Column is encrypted using TCE
345
346         // null values
347         public const uint VARLONGNULL = 0xffffffff; // null value for text and image types
348         public const int VARNULL = 0xffff;    // null value for character and binary types
349         public const int MAXSIZE = 8000; // max size for any column
350         public const byte FIXEDNULL  = 0;
351         public const UInt64 UDTNULL = 0xffffffffffffffff;
352
353         // SQL Server Data Type Tokens.
354         public const int SQLVOID         = 0x1f;
355         public const int SQLTEXT         = 0x23;
356         public const int SQLVARBINARY    = 0x25;
357         public const int SQLINTN         = 0x26;
358         public const int SQLVARCHAR      = 0x27;
359         public const int SQLBINARY       = 0x2d;
360         public const int SQLIMAGE        = 0x22;
361         public const int SQLCHAR         = 0x2f;
362         public const int SQLINT1         = 0x30;
363         public const int SQLBIT          = 0x32;
364         public const int SQLINT2         = 0x34;
365         public const int SQLINT4         = 0x38;
366         public const int SQLMONEY        = 0x3c;
367         public const int SQLDATETIME     = 0x3d;
368         public const int SQLFLT8         = 0x3e;
369         public const int SQLFLTN         = 0x6d;
370         public const int SQLMONEYN       = 0x6e;
371         public const int SQLDATETIMN     = 0x6f;
372         public const int SQLFLT4         = 0x3b;
373         public const int SQLMONEY4       = 0x7a;
374         public const int SQLDATETIM4     = 0x3a;
375         public const int SQLDECIMALN     = 0x6a;
376         public const int SQLNUMERICN     = 0x6c;
377         public const int SQLUNIQUEID     = 0x24;
378         public const int SQLBIGCHAR      = 0xaf;
379         public const int SQLBIGVARCHAR   = 0xa7;
380         public const int SQLBIGBINARY    = 0xad;
381         public const int SQLBIGVARBINARY = 0xa5;
382         public const int SQLBITN         = 0x68;
383         public const int SQLNCHAR        = 0xef;
384         public const int SQLNVARCHAR     = 0xe7;
385         public const int SQLNTEXT        = 0x63;
386         public const int SQLUDT          = 0xF0;
387
388         // aggregate operator type TDS tokens, used by compute statements:
389         public const int AOPCNTB         = 0x09;
390         public const int AOPSTDEV        = 0x30;
391         public const int AOPSTDEVP       = 0x31;
392         public const int AOPVAR          = 0x32;
393         public const int AOPVARP         = 0x33;
394
395         public const int AOPCNT          = 0x4b;
396         public const int AOPSUM          = 0x4d;
397         public const int AOPAVG          = 0x4f;
398         public const int AOPMIN          = 0x51;
399         public const int AOPMAX          = 0x52;
400         public const int AOPANY          = 0x53;
401         public const int AOPNOOP         = 0x56;
402
403         // SQL Server user-defined type tokens we care about
404         public const int SQLTIMESTAMP   = 0x50;
405
406         public const int  MAX_NUMERIC_LEN = 0x11; // 17 bytes of data for max numeric/decimal length
407         public const int  DEFAULT_NUMERIC_PRECISION = 0x1D; // 29 is the default max numeric precision(Decimal.MaxValue) if not user set
408         public const int  SPHINX_DEFAULT_NUMERIC_PRECISION = 0x1C; // 28 is the default max numeric precision for Sphinx(Decimal.MaxValue doesn't work for sphinx)
409         public const int  MAX_NUMERIC_PRECISION = 0x26; // 38 is max numeric precision;
410         public const byte UNKNOWN_PRECISION_SCALE = 0xff; // -1 is value for unknown precision or scale
411
412         // The following datatypes are specific to SHILOH (version 8) and later.
413         public const int SQLINT8    = 0x7f;
414         public const int SQLVARIANT = 0x62;
415
416         // The following datatypes are specific to Yukon (version 9) or later
417         public const int SQLXMLTYPE    = 0xf1;
418         public const int XMLUNICODEBOM = 0xfeff;
419         public static readonly byte[] XMLUNICODEBOMBYTES = { 0xff, 0xfe };
420
421         // The following datatypes are specific to Katmai (version 10) or later
422         public const int SQLTABLE          = 0xf3;
423         public const int SQLDATE           = 0x28;
424         public const int SQLTIME           = 0x29;
425         public const int SQLDATETIME2      = 0x2a;
426         public const int SQLDATETIMEOFFSET = 0x2b;
427
428         public const int DEFAULT_VARTIME_SCALE = 7;
429
430         //Partially length prefixed datatypes constants. These apply to XMLTYPE, BIGVARCHRTYPE,
431         // NVARCHARTYPE, and BIGVARBINTYPE. Valid for Yukon or later
432
433         public const ulong SQL_PLP_NULL = 0xffffffffffffffff;        // Represents null value
434         public const ulong SQL_PLP_UNKNOWNLEN = 0xfffffffffffffffe;  // Data coming in chunks, total length unknown
435         public const int SQL_PLP_CHUNK_TERMINATOR = 0x00000000;     // Represents end of chunked data.
436         public const ushort SQL_USHORTVARMAXLEN = 0xffff;          // Second ushort in TDS stream is this value if one of max types
437
438         // TVPs require some new in-value control tokens:
439         public const byte TVP_ROWCOUNT_ESTIMATE = 0x12;
440         public const byte TVP_ROW_TOKEN         = 0x01;
441         public const byte TVP_END_TOKEN         = 0x00;
442         public const ushort TVP_NOMETADATA_TOKEN  = 0xFFFF;
443         public const byte TVP_ORDER_UNIQUE_TOKEN = 0x10;
444
445         // TvpColumnMetaData flags
446         public const int  TVP_DEFAULT_COLUMN    = 0x200;
447
448         // TVP_ORDER_UNIQUE_TOKEN flags
449         public const byte TVP_ORDERASC_FLAG     = 0x1;
450         public const byte TVP_ORDERDESC_FLAG    = 0x2;
451         public const byte TVP_UNIQUE_FLAG       = 0x4;
452
453         public const bool Is68K    = false;
454         public const bool TraceTDS = false;
455
456         // RPC function names
457         public const string SP_EXECUTESQL     = "sp_executesql";       // used against 7.0 servers
458         public const string SP_PREPEXEC       = "sp_prepexec";         // used against 7.5 servers
459
460         public const string SP_PREPARE        = "sp_prepare";          // used against 7.0 servers
461         public const string SP_EXECUTE        = "sp_execute";
462         public const string SP_UNPREPARE      = "sp_unprepare";
463         public const string SP_PARAMS         = "sp_procedure_params_rowset";
464         public const string SP_PARAMS_MANAGED = "sp_procedure_params_managed";
465         public const string SP_PARAMS_MGD10   = "sp_procedure_params_100_managed";
466
467         // RPC ProcID's
468         // NOTE: It is more efficient to call these procs using ProcID's instead of names
469         public const ushort RPC_PROCID_CURSOR = 1;
470         public const ushort RPC_PROCID_CURSOROPEN = 2;
471         public const ushort RPC_PROCID_CURSORPREPARE = 3;
472         public const ushort RPC_PROCID_CURSOREXECUTE = 4;
473         public const ushort RPC_PROCID_CURSORPREPEXEC = 5;
474         public const ushort RPC_PROCID_CURSORUNPREPARE = 6;
475         public const ushort RPC_PROCID_CURSORFETCH = 7;
476         public const ushort RPC_PROCID_CURSOROPTION = 8;
477         public const ushort RPC_PROCID_CURSORCLOSE = 9;
478         public const ushort RPC_PROCID_EXECUTESQL = 10;
479         public const ushort RPC_PROCID_PREPARE = 11;
480         public const ushort RPC_PROCID_EXECUTE = 12;
481         public const ushort RPC_PROCID_PREPEXEC = 13;
482         public const ushort RPC_PROCID_PREPEXECRPC = 14;
483         public const ushort RPC_PROCID_UNPREPARE = 15;
484
485         // For Transactions
486         public const string TRANS_BEGIN       = "BEGIN TRANSACTION";
487         public const string TRANS_COMMIT      = "COMMIT TRANSACTION";
488         public const string TRANS_ROLLBACK    = "ROLLBACK TRANSACTION";
489         public const string TRANS_IF_ROLLBACK = "IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION";
490         public const string TRANS_SAVE        = "SAVE TRANSACTION";
491
492         // For Transactions - isolation levels
493         public const string TRANS_READ_COMMITTED   = "SET TRANSACTION ISOLATION LEVEL READ COMMITTED";
494         public const string TRANS_READ_UNCOMMITTED = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED";
495         public const string TRANS_REPEATABLE_READ  = "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ";
496         public const string TRANS_SERIALIZABLE     = "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE";
497         public const string TRANS_SNAPSHOT         = "SET TRANSACTION ISOLATION LEVEL SNAPSHOT";
498
499         // Batch RPC flags
500         public const byte SHILOH_RPCBATCHFLAG = 0x80;
501         public const byte YUKON_RPCBATCHFLAG = 0xFF;
502
503         // RPC flags
504         public const byte RPC_RECOMPILE = 0x1;
505         public const byte RPC_NOMETADATA = 0x2;
506
507         // RPC parameter class
508         public const byte RPC_PARAM_BYREF         = 0x1;
509         public const byte RPC_PARAM_DEFAULT       = 0x2;
510         public const byte RPC_PARAM_ENCRYPTED     = 0x8;
511
512         // SQL parameter list text
513         public const string PARAM_OUTPUT = "output";
514
515         // SQL Parameter constants
516         public const int    MAX_PARAMETER_NAME_LENGTH = 128;
517
518         // metadata options (added around an existing sql statement)
519
520         // prefixes
521         public const string FMTONLY_ON = " SET FMTONLY ON;";
522         public const string FMTONLY_OFF = " SET FMTONLY OFF;";
523         // suffixes
524         public const string BROWSE_ON  = " SET NO_BROWSETABLE ON;";
525         public const string BROWSE_OFF  = " SET NO_BROWSETABLE OFF;";
526
527         // generic table name
528         public const string TABLE = "Table";
529
530         public const int EXEC_THRESHOLD = 0x3; // if the number of commands we execute is > than this threshold, than do prep/exec/unprep instead
531         // of executesql.
532
533         // dbnetlib error values
534         public const short TIMEOUT_EXPIRED          = -2;
535         public const short ENCRYPTION_NOT_SUPPORTED = 20;
536         // CAUTION: These are not error codes returned by SNI. This is used for backward compatibility
537         // since netlib (now removed from sqlclient) returned these codes.
538
539         // SQL error values (from sqlerrorcodes.h)
540         public const int LOGON_FAILED     = 18456;
541         public const int PASSWORD_EXPIRED = 18488;
542         public const int IMPERSONATION_FAILED = 1346;
543         public const int P_TOKENTOOLONG = 103;
544
545         // SNI\Win32 error values
546         // NOTE: these are simply windows system error codes, not SNI specific
547         public const uint  SNI_UNINITIALIZED        = unchecked((uint)-1);
548         public const uint  SNI_SUCCESS              = 0;        // The operation completed successfully.
549         public const uint  SNI_WAIT_TIMEOUT         = 258;      // The wait operation timed out.
550         public const uint  SNI_SUCCESS_IO_PENDING   = 997;      // Overlapped I/O operation is in progress.
551
552         // Windows Sockets Error Codes
553         public const short SNI_WSAECONNRESET        = 10054;    // An existing connection was forcibly closed by the remote host.
554
555         // SNI flags
556         public const UInt32  SNI_SSL_VALIDATE_CERTIFICATE = 1;   // This enables validation of server certificate
557         public const UInt32  SNI_SSL_USE_SCHANNEL_CACHE = 2;     // This enables schannel session cache
558         public const UInt32  SNI_SSL_IGNORE_CHANNEL_BINDINGS = 0x10; // Used with SSL Provider, sent to SNIAddProvider in case of SQL Authentication & Encrypt.
559
560         public const string DEFAULT_ENGLISH_CODE_PAGE_STRING = "iso_1";
561         public const short  DEFAULT_ENGLISH_CODE_PAGE_VALUE  = 1252;
562         public const short  CHARSET_CODE_PAGE_OFFSET         = 2;
563         internal const int MAX_SERVERNAME = 255;
564
565         // Sql Statement Tokens in the DONE packet
566         // (see ntdbms\ntinc\tokens.h)
567         //
568         internal const ushort SELECT =      0xc1;
569         internal const ushort INSERT =      0xc3;
570         internal const ushort DELETE =      0xc4;
571         internal const ushort UPDATE =      0xc5;
572         internal const ushort ABORT =       0xd2;
573         internal const ushort BEGINXACT =   0xd4;
574         internal const ushort ENDXACT =     0xd5;
575         internal const ushort BULKINSERT =  0xf0;
576         internal const ushort OPENCURSOR =  0x20;
577         internal const ushort MERGE =       0x117;
578
579
580         // Login data validation Rules
581         //
582         internal const ushort MAXLEN_HOSTNAME =         128; // the client machine name
583         internal const ushort MAXLEN_USERNAME =         128; // the client user id
584         internal const ushort MAXLEN_PASSWORD =         128; // the password supplied by the client
585         internal const ushort MAXLEN_APPNAME =          128; // the client application name
586         internal const ushort MAXLEN_SERVERNAME =       128; // the server name
587         internal const ushort MAXLEN_CLIENTINTERFACE =  128; // the interface library name
588         internal const ushort MAXLEN_LANGUAGE =         128; // the initial language
589         internal const ushort MAXLEN_DATABASE =         128; // the initial database
590         internal const ushort MAXLEN_ATTACHDBFILE =     260; // the filename for a database that is to be attached during the connection process
591         internal const ushort MAXLEN_NEWPASSWORD =      128; // new password for the specified login.
592
593
594         // array copied directly from tdssort.h from luxor
595         public static readonly UInt16[] CODE_PAGE_FROM_SORT_ID = {
596             0,      /*   0 */
597             0,      /*   1 */
598             0,      /*   2 */
599             0,      /*   3 */
600             0,      /*   4 */
601             0,      /*   5 */
602             0,      /*   6 */
603             0,      /*   7 */
604             0,      /*   8 */
605             0,      /*   9 */
606             0,      /*  10 */
607             0,      /*  11 */
608             0,      /*  12 */
609             0,      /*  13 */
610             0,      /*  14 */
611             0,      /*  15 */
612             0,      /*  16 */
613             0,      /*  17 */
614             0,      /*  18 */
615             0,      /*  19 */
616             0,      /*  20 */
617             0,      /*  21 */
618             0,      /*  22 */
619             0,      /*  23 */
620             0,      /*  24 */
621             0,      /*  25 */
622             0,      /*  26 */
623             0,      /*  27 */
624             0,      /*  28 */
625             0,      /*  29 */
626             437,    /*  30 */
627             437,    /*  31 */
628             437,    /*  32 */
629             437,    /*  33 */
630             437,    /*  34 */
631             0,      /*  35 */
632             0,      /*  36 */
633             0,      /*  37 */
634             0,      /*  38 */
635             0,      /*  39 */
636             850,    /*  40 */
637             850,    /*  41 */
638             850,    /*  42 */
639             850,    /*  43 */
640             850,    /*  44 */
641             0,      /*  45 */
642             0,      /*  46 */
643             0,      /*  47 */
644             0,      /*  48 */
645             850,    /*  49 */
646             1252,   /*  50 */
647             1252,   /*  51 */
648             1252,   /*  52 */
649             1252,   /*  53 */
650             1252,   /*  54 */
651             850,    /*  55 */
652             850,    /*  56 */
653             850,    /*  57 */
654             850,    /*  58 */
655             850,    /*  59 */
656             850,    /*  60 */
657             850,    /*  61 */
658             0,      /*  62 */
659             0,      /*  63 */
660             0,      /*  64 */
661             0,      /*  65 */
662             0,      /*  66 */
663             0,      /*  67 */
664             0,      /*  68 */
665             0,      /*  69 */
666             0,      /*  70 */
667             1252,   /*  71 */
668             1252,   /*  72 */
669             1252,   /*  73 */
670             1252,   /*  74 */
671             1252,   /*  75 */
672             0,      /*  76 */
673             0,      /*  77 */
674             0,      /*  78 */
675             0,      /*  79 */
676             1250,   /*  80 */
677             1250,   /*  81 */
678             1250,   /*  82 */
679             1250,   /*  83 */
680             1250,   /*  84 */
681             1250,   /*  85 */
682             1250,   /*  86 */
683             1250,   /*  87 */
684             1250,   /*  88 */
685             1250,   /*  89 */
686             1250,   /*  90 */
687             1250,   /*  91 */
688             1250,   /*  92 */
689             1250,   /*  93 */
690             1250,   /*  94 */
691             1250,   /*  95 */
692             1250,   /*  96 */
693             1250,   /*  97 */
694             1250,   /*  98 */
695             0,      /*  99 */
696             0,      /* 100 */
697             0,      /* 101 */
698             0,      /* 102 */
699             0,      /* 103 */
700             1251,   /* 104 */
701             1251,   /* 105 */
702             1251,   /* 106 */
703             1251,   /* 107 */
704             1251,   /* 108 */
705             0,      /* 109 */
706             0,      /* 110 */
707             0,      /* 111 */
708             1253,   /* 112 */
709             1253,   /* 113 */
710             1253,   /* 114 */
711             0,      /* 115 */
712             0,      /* 116 */
713             0,      /* 117 */
714             0,      /* 118 */
715             0,      /* 119 */
716             1253,   /* 120 */
717             1253,   /* 121 */
718             1253,   /* 122 */
719             0,      /* 123 */
720             1253,   /* 124 */
721             0,      /* 125 */
722             0,      /* 126 */
723             0,      /* 127 */
724             1254,   /* 128 */
725             1254,   /* 129 */
726             1254,   /* 130 */
727             0,      /* 131 */
728             0,      /* 132 */
729             0,      /* 133 */
730             0,      /* 134 */
731             0,      /* 135 */
732             1255,   /* 136 */
733             1255,   /* 137 */
734             1255,   /* 138 */
735             0,      /* 139 */
736             0,      /* 140 */
737             0,      /* 141 */
738             0,      /* 142 */
739             0,      /* 143 */
740             1256,   /* 144 */
741             1256,   /* 145 */
742             1256,   /* 146 */
743             0,      /* 147 */
744             0,      /* 148 */
745             0,      /* 149 */
746             0,      /* 150 */
747             0,      /* 151 */
748             1257,   /* 152 */
749             1257,   /* 153 */
750             1257,   /* 154 */
751             1257,   /* 155 */
752             1257,   /* 156 */
753             1257,   /* 157 */
754             1257,   /* 158 */
755             1257,   /* 159 */
756             1257,   /* 160 */
757             0,      /* 161 */
758             0,      /* 162 */
759             0,      /* 163 */
760             0,      /* 164 */
761             0,      /* 165 */
762             0,      /* 166 */
763             0,      /* 167 */
764             0,      /* 168 */
765             0,      /* 169 */
766             0,      /* 170 */
767             0,      /* 171 */
768             0,      /* 172 */
769             0,      /* 173 */
770             0,      /* 174 */
771             0,      /* 175 */
772             0,      /* 176 */
773             0,      /* 177 */
774             0,      /* 178 */
775             0,      /* 179 */
776             0,      /* 180 */
777             0,      /* 181 */
778             0,      /* 182 */
779             1252,   /* 183 */
780             1252,   /* 184 */
781             1252,   /* 185 */
782             1252,   /* 186 */
783             0,      /* 187 */
784             0,      /* 188 */
785             0,      /* 189 */
786             0,      /* 190 */
787             0,      /* 191 */
788             932,    /* 192 */
789             932,    /* 193 */
790             949,    /* 194 */
791             949,    /* 195 */
792             950,    /* 196 */
793             950,    /* 197 */
794             936,    /* 198 */
795             936,    /* 199 */
796             932,    /* 200 */
797             949,    /* 201 */
798             950,    /* 202 */
799             936,    /* 203 */
800             874,    /* 204 */
801             874,    /* 205 */
802             874,    /* 206 */
803             0,      /* 207 */
804             0,      /* 208 */
805             0,      /* 209 */
806             1252,   /* 210 */
807             1252,   /* 211 */
808             1252,   /* 212 */
809             1252,   /* 213 */
810             1252,   /* 214 */
811             1252,   /* 215 */
812             1252,   /* 216 */
813             1252,   /* 217 */
814             0,      /* 218 */
815             0,      /* 219 */
816             0,      /* 220 */
817             0,      /* 221 */
818             0,      /* 222 */
819             0,      /* 223 */
820             0,      /* 224 */
821             0,      /* 225 */
822             0,      /* 226 */
823             0,      /* 227 */
824             0,      /* 228 */
825             0,      /* 229 */
826             0,      /* 230 */
827             0,      /* 231 */
828             0,      /* 232 */
829             0,      /* 233 */
830             0,      /* 234 */
831             0,      /* 235 */
832             0,      /* 236 */
833             0,      /* 237 */
834             0,      /* 238 */
835             0,      /* 239 */
836             0,      /* 240 */
837             0,      /* 241 */
838             0,      /* 242 */
839             0,      /* 243 */
840             0,      /* 244 */
841             0,      /* 245 */
842             0,      /* 246 */
843             0,      /* 247 */
844             0,      /* 248 */
845             0,      /* 249 */
846             0,      /* 250 */
847             0,      /* 251 */
848             0,      /* 252 */
849             0,      /* 253 */
850             0,      /* 254 */
851             0,      /* 255 */
852         };
853
854         internal enum UDTFormatType {
855             Native      = 1,
856             UserDefined = 2
857         }
858
859         internal enum TransactionManagerRequestType {
860             GetDTCAddress = 0,
861             Propagate     = 1,
862             Begin         = 5,
863             Promote       = 6,
864             Commit        = 7,
865             Rollback      = 8,
866             Save          = 9
867         };
868
869         internal enum TransactionManagerIsolationLevel {
870             Unspecified     = 0x00,
871             ReadUncommitted = 0x01,
872             ReadCommitted   = 0x02,
873             RepeatableRead  = 0x03,
874             Serializable    = 0x04,
875             Snapshot        = 0x05
876         }
877
878         internal enum GenericType {
879             MultiSet = 131,
880         };
881         
882         // Date, Time, DateTime2, DateTimeOffset specific constants
883         internal static readonly Int64[] TICKS_FROM_SCALE = {
884             10000000,
885             1000000,
886             100000,
887             10000,
888             1000,
889             100,
890             10,
891             1,
892         };
893
894         internal const int MAX_TIME_SCALE = 7; // Maximum scale for time-related types
895         internal const int MAX_TIME_LENGTH = 5; // Maximum length for time
896         internal const int MAX_DATETIME2_LENGTH = 8; // Maximum length for datetime2
897         internal const int WHIDBEY_DATE_LENGTH = 10;
898         internal static readonly int[] WHIDBEY_TIME_LENGTH = { 8, 10, 11, 12, 13, 14, 15, 16 };
899         internal static readonly int[] WHIDBEY_DATETIME2_LENGTH = { 19, 21, 22, 23, 24, 25, 26, 27 };
900         internal static readonly int[] WHIDBEY_DATETIMEOFFSET_LENGTH = {26, 28, 29, 30, 31, 32, 33, 34 };
901
902         internal enum FedAuthInfoId:byte {
903             Stsurl = 0x01, // FedAuthInfoData is token endpoint URL from which to acquire fed auth token
904             Spn    = 0x02, // FedAuthInfoData is the SPN to use for acquiring fed auth token
905         }
906
907         // TCE Related constants
908         internal const byte MAX_SUPPORTED_TCE_VERSION = 0x01; // max version
909         internal const ushort MAX_TCE_CIPHERINFO_SIZE = 2048; // max size of cipherinfo blob
910         internal const long MAX_TCE_CIPHERTEXT_SIZE = 2147483648; // max size of encrypted blob- currently 2GB.
911         internal const byte CustomCipherAlgorithmId = 0; // Id used for custom encryption algorithm.
912
913         internal const int AES_256_CBC = 1;
914         internal const int AEAD_AES_256_CBC_HMAC_SHA256 = 2;
915
916         // TCE Param names for exec handling
917         internal const string TCE_PARAM_CIPHERTEXT = "cipherText";
918         internal const string TCE_PARAM_CIPHER_ALGORITHM_ID="cipherAlgorithmId";
919         internal const string TCE_PARAM_COLUMNENCRYPTION_KEY="columnEncryptionKey";
920         internal const string TCE_PARAM_ENCRYPTION_ALGORITHM="encryptionAlgorithm";
921         internal const string TCE_PARAM_ENCRYPTIONTYPE = "encryptionType";
922         internal const string TCE_PARAM_ENCRYPTIONKEY = "encryptionKey";
923         internal const string TCE_PARAM_MASTERKEY_PATH = "masterKeyPath";
924         internal const string TCE_PARAM_ENCRYPTED_CEK = "encryptedColumnEncryptionKey";
925         internal const string TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS="clientKeyStoreProviders";
926         internal const string TCE_PARAM_FORCE_COLUMN_ENCRYPTION="ForceColumnEncryption(true)";
927     }
928
929     internal enum ParsingErrorState {
930         Undefined = 0,
931         FedAuthInfoLengthTooShortForCountOfInfoIds = 1,
932         FedAuthInfoLengthTooShortForData = 2,
933         FedAuthInfoFailedToReadCountOfInfoIds = 3,
934         FedAuthInfoFailedToReadTokenStream = 4,
935         FedAuthInfoInvalidOffset = 5,
936         FedAuthInfoFailedToReadData = 6,
937         FedAuthInfoDataNotUnicode = 7,
938         FedAuthInfoDoesNotContainStsurlAndSpn = 8,
939         FedAuthInfoNotReceived = 9,
940         FedAuthNotAcknowledged = 10,
941         FedAuthFeatureAckContainsExtraData = 11,
942         FedAuthFeatureAckUnknownLibraryType = 12,
943         UnrequestedFeatureAckReceived = 13,
944         UnknownFeatureAck = 14,
945         InvalidTdsTokenReceived = 15,
946         SessionStateLengthTooShort = 16,
947         SessionStateInvalidStatus = 17,
948         CorruptedTdsStream = 18,
949         ProcessSniPacketFailed = 19,
950         FedAuthRequiredPreLoginResponseInvalidValue = 20,
951         TceUnknownVersion = 21,
952         TceInvalidVersion = 22,
953         TceInvalidOrdinalIntoCipherInfoTable = 23,
954     }
955
956     internal enum SniContext {
957         Undefined = 0,
958         Snix_Connect,
959         Snix_PreLoginBeforeSuccessfullWrite,
960         Snix_PreLogin,
961         Snix_LoginSspi,
962         Snix_ProcessSspi,
963         Snix_Login,
964         Snix_EnableMars,
965         Snix_AutoEnlist,
966         Snix_GetMarsSession,
967         Snix_Execute,
968         Snix_Read,
969         Snix_Close,
970         Snix_SendRows,
971     }
972
973     /// <summary>
974     /// Column Encryption Setting to be used for the SqlConnection.
975     /// </summary>
976     public enum SqlConnectionColumnEncryptionSetting {
977         /// <summary>
978         /// Disables column encryption by default on all commands on this connection.
979         /// </summary>
980         Disabled = 0,
981
982         /// <summary>
983         /// Enables column encryption by default on all commands on this connection.
984         /// </summary>
985         Enabled,
986     }
987
988     /// <summary>
989     /// Column Encryption Setting to be used for the SqlCommand.
990     /// </summary>
991     public enum SqlCommandColumnEncryptionSetting {
992         /// <summary>
993         /// if \93Column Encryption Setting=Enabled\94 in the connection string, use Enabled. Otherwise, maps to Disabled.
994         /// </summary>
995         UseConnectionSetting = 0,
996
997         /// <summary>
998         /// Enables TCE for the command. Overrides the connection level setting for this command.
999         /// </summary>
1000         Enabled,
1001
1002         /// <summary>
1003         /// Parameters will not be encrypted, only the ResultSet will be decrypted. This is an optimization for queries that do not pass any encrypted input parameters.
1004         /// Overrides the connection level setting for this command.
1005         /// </summary>
1006         ResultSetOnly,
1007
1008         /// <summary>
1009         /// Disables TCE for the command.Overrides the connection level setting for this command.
1010         /// </summary>
1011         Disabled,
1012     }
1013
1014     public enum SqlAuthenticationMethod {
1015         NotSpecified = 0,
1016         SqlPassword,
1017         ActiveDirectoryPassword,
1018         ActiveDirectoryIntegrated,
1019     }
1020
1021     internal class ActiveDirectoryAuthentication
1022     {
1023         internal const string AdoClientId = "4d079b4c-cab7-4b7c-a115-8fd51b6f8239";
1024         internal const string AdalGetAccessTokenFunctionName = "ADALGetAccessToken";
1025         internal const int GetAccessTokenSuccess = 0;
1026         internal const int GetAccessTokenInvalidGrant = 1;
1027         internal const int GetAccessTokenTansisentError = 2;
1028         internal const int GetAccessTokenOtherError = 3;
1029     }
1030
1031     // Fields in the first resultset of "sp_describe_parameter_encryption".
1032     // We expect the server to return the fields in the resultset in the same order as mentioned below.
1033     // If the server changes the below order, then transparent parameter encryption will break.
1034     internal enum DescribeParameterEncryptionResultSet1 {
1035         KeyOrdinal = 0,
1036         DbId,
1037         KeyId,
1038         KeyVersion,
1039         KeyMdVersion,
1040         EncryptedKey,
1041         ProviderName,
1042         KeyPath,
1043         KeyEncryptionAlgorithm,
1044     }
1045
1046     // Fields in the second resultset of "sp_describe_parameter_encryption"
1047     // We expect the server to return the fields in the resultset in the same order as mentioned below.
1048     // If the server changes the below order, then transparent parameter encryption will break.
1049     internal enum DescribeParameterEncryptionResultSet2 {
1050         ParameterOrdinal = 0,
1051         ParameterName,
1052         ColumnEncryptionAlgorithm,
1053         ColumnEncrytionType,
1054         ColumnEncryptionKeyOrdinal,
1055         NormalizationRuleVersion,
1056     }
1057 }