Client 6 Client 14 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Server 4 Status Status is a bit field used to indicate the message state. Status is a 1-byte unsigned char. The following Status bit flags are defined. Value Description 0x00 "Normal" message. 0x01 End of message (EOM). The packet is the last packet in the whole request. 0x02 (From client to server) Ignore this event (0x01 MUST also be set). 0x08 RESETCONNECTION (Introduced in TDS 7.1) (From client to server) Reset this connection before processing event. Only set for event types Batch, RPC, or request. If clients want to set this bit, it MUST be part of the first packet of the message. This signals the server to clean up the environment state of the connection back to the default
AOPAVG = %x4F ; Average of the values in the rows (AVG) AOPMIN = %x51 ; Minimum value of the rows (MIN) AOPMAX = %x52 ; Maximum of the rows (MAX) Operand The column number, starting from 1, in the result set that is the operand to the aggregate operator. UserType The user typeID of the data type of the column. The value will be 0x0000 with the exceptions of TIMESTAMP (0x0050) and alias types (greater than 0x00FF). These bit flags are described in . With the exception of fNullable, all of these bit flags SHOULD be set to zero. For a description of each bit flag, see section : fNullable is a bit flag, 1 if the column is nullable. fCaseSen usUpdateable fIdentity fComputed usReservedODBC fFixedLenCLRType TableName See section 2.2.7.4 for a description of TableName. This
Token Stream Comments: The token value is 0xE3. Includes old and new environment values. Type 4 (Packet size) is sent in response to a LOGIN7 message. The server MAY send a value different from the packet size requested by the client. That value MUST be greater than or equal to 512 and smaller than or equal to 32767. Both the client and the server MUST start using this value for packet size with the message following the login response message. Type 13 (Database Mirroring) is sent in response to a LOGIN7 message whenever connection is requested to a database that it is being served as primary in real-time log shipping. The ENVCHANGE stream reflects the name of the partner node of the database that is being log shipped. Type 15 (Promote Transaction) is sent in response to transaction manager requests with requests of type 6 (TM_PROMOTE_XACT). Type 16 (Transaction Manager Address) is sent in response to transaction manager requests with requests of type 0 (TM_GET_DTC_ADDRESS). Type 20 (Routing) is sent in response to a LOGIN7 message when the server wants to route the client to an alternate server. The ENVCHANGE stream returns routing information for the alternate server. If the server decides to send the Routing ENVCHANGE token, the Routing ENVCHANGE token MUST be sent after the LOGINACK token in the login response. Token Stream-Specific Rules: TokenType = BYTE Length = USHORT Type = BYTE EnvValueData = Type NewValue [OldValue] Token Stream Definition: ENVCHANGE = TokenType Length EnvValueData Stream Parameter Details Parameter Description TokenType ENVCHANGE_TOKEN Length The total length of the ENVCHANGE data stream (EnvValueData). Type The type of environment change: Note Types 8 to 19 were introduced in TDS 7.2. Type 20 was introduced in TDS 7.4. 1: Database 2: Language
7: SQL Collation OLDVALUE = B_VARBYTE NEWVALUE = B_VARBYTE 8: Begin Transaction OLDVALUE = %x00 NEWVALUE = B_VARBYTE 9: Commit Transaction OLDVALUE = B_VARBYTE NEWVALUE = "0x00" 10: Rollback Transaction OLDVALUE = B_VARBYTE NEWVALUE = %x00 11: Enlist DTC Transaction OLDVALUE = B_VARBYTE NEWVALUE = %x00 12: Defect Transaction OLDVALUE = %x00 NEWVALUE = B_VARBYTE 13: Database Mirroring Partner OLDVALUE = %x00 PARTNER_NODE = B_VARCHAR NEWVALUE = PARTNER_NODE 15: Promote Transaction OLDVALUE = %x00 DTC_TOKEN = L_VARBYTE; NEWVALUE = DTC_TOKEN 16: Transaction Manager Address (not used) OLDVALUE = %x00 XACT_MANAGER_ADDRESS = B_VARBYTE NEWVALUE = XACT_MANAGER_ADDRESS 17: Transaction Ended OLDVALUE = B_VARBYTE NEWVALUE = %x00 18: Completion Acknowledgement OLDVALUE = %x00 NEWVALUE = %x00 19: Sends back info of user instance for logins (login7) requesting so. OLDVALUE = %x00 NEWVALUE = B_VARCHAR 20: Routing OLDVALUE = %x00 %x00 Protocol = BYTE ProtocolProperty = USHORT AlternateServer = US_VARCHAR Protocol MUST be 0, specifying TCP-IP protocol. ProtocolProperty represents the TCP-IP port when Protocol is 0. A ProtocolProperty value of
action is required. 19 A Database Engine limit has been exceeded and the current SQL batch has been terminated. Error messages with a severity level of 19 or higher stop the execution of the current SQL batch. Severity level 19 errors are rare and can be corrected only by the system administrator. Error messages with a severity level from 19 through 25 are written to the error log. System problems have occurred. These are fatal errors, which means the Database Engine task that was executing a SQL batch is no longer running. The task records information about what occurred and then terminates. In most cases, the application
Protocol syntax refers to data elements (such as packets, structures, enumerations, and methods) as well as interfaces. Protocol revision refers to changes made to a protocol that affect the bits that are sent over the wire. The changes made to this document are listed in the following table. For more information, please contact . Section Tracking number (if applicable) and description Major change (Y or N) Change type Overview Added .NET Framework versions and SQL Server 2016 CTP2 to the product behavior note. Y Product behavior note updated. Prerequisites/Preconditions Added product behavior note about SQL Server support of federated authentication. New product behavior note added. Versioning and Capability Negotiation Added product behavior note about SQL Server support of federated authentication. Y New product behavior note Message Syntax Updated products that support VIA in product behavior note. Y Product behavior note updated. Client Messages Added Federated Authentication Token to the list of client messages. Y Content update. Login Added product behavior note about SQL Server support of federated authentication. Y New product behavior note added. Federated Authentication Token a summary of the federated authentication token in client messages. Y New content added. Server Messages Added Federated Authentication Information to the list of server messages. Y Content update. Federated Authentication Information Added a summary statement about federated authentication information in server messages. Y New content added.
authentication feature extension. PRELOGIN Added column encryption rules and stream parameter details. Y Content update. 2.2.6.5 PRELOGIN product behavior note about SQL Server support for federated authentication. Y New product behavior note added. 2.2.6.5 PRELOGIN Added product behavior note about SQL Server support for federated authentication. Y New product behavior note RPC Request Added information about parameters DatabaseId, CekId, CekVersion, and CekMDVersion. Y Content update. ALTMETADATA Clarified order of fNullable and fCaseSen flags. Y Content update. COLMETADATA Clarified order of fNullable and fCaseSen flags. Y Content update. 2.2.7.4 COLMETADATA 70855 : Added a count of columns in the token stream definition and clarified the size of the Flags parameter. Y Content update. 2.2.7.4 COLMETADATA Added the token stream-specific rules, token stream definition, and token stream parameter details for column encryption. Y Content update. 2.2.7.4 COLMETADATA 4160053 : Updated description of CryptoMetaData for EncryptionAlgo, AlgoName, EncryptionAlgoType, and NormVersion. Y Content update. FEATUREEXTACK Added product behavior note about Y New product
Sent TLS/SSL Negotiation Packet State Added product behavior note about SQL Server support for FEDAUTH FeatureExt. Y New product behavior note added. 3.2.5.2 Sent TLS/SSL Negotiation Packet State Added server state information about FEDAUTH FeatureExt and Sent LOGIN7 record with Federated Authentication Information Request state. Y Content update. Sent LOGIN7 Record with Complete Authentication Token State Added product behavior note about SQL Server support of federated authentication. Y New product behavior note added. 3.2.5.3 Sent LOGIN7 Record with Complete Authentication State Added Active Directory Authentication Library value to bFedAuthLibrary information. Y Content update. Sent LOGIN7 Record with Federated Authentication Information Request State information about the response received from the server when federated authentication information is requested at log in. Y Content update. Server Details Added federated authentication information to TDS server state machine diagram. Y Content update. 3.3 Server Details Added information about federated authentication to the TDS server state machine diagram. Y Content update. Abstract Data Model Added the Federated Authentication Ready State to the list of server states. Y Content update. Initial State Added product behavior note about SQL Server support of Federated Authentication. Y New product behavior note added.
Ready State Added product behavior note about SQL Server support of Federated Authentication. Y New product behavior note added. 3.3.5.3 Ready State information about the bFedAuthLibrary value of Active Directory Authentication Library. Y Content update. 3.3.5.3 Login Ready State information about the rules for server processing of a federated authentication token from the client. Y New content Login Request with Federated Authentication Added product behavior note about SQL Server support of federated authentication. Y New product behavior note added. Response with Federated Authentication Feature Extension Acknowledgement Added product behavior note about SQL Server support of federated authentication. Y New product behavior note added. Security Considerations for Implementers Added product behavior note about SQL Server support of federated authentication. Y New product behavior note of Security Parameters 4160055 : Added section. Y New content added for template compliance. Appendix A: Product Behavior Added .NET Framework versions and SQL Server 2016 CTP2 to the list of applicable products. Y Content update.
A Abstract data model client ( 112, 118) server ( 112, 126) ALL_HEADERS rule definition 33 33 34 16 19 156 178 27 C 16 185 Client abstract data model ( 112, 118) higher-layer triggered events ( 112, 120) initialization ( 112, 119) local events ( 117, 125) message processing ( 112, 121) 125 124 121 124 124 121 123 123 122 messages 19 18 17 18 18 18 18 19 125 overview ( 112, 118) sequencing rules ( 112, 121) 125 124 121 124 124 121 123 123 122 timer events ( 117, 125) timers ( 112, 119) 17 131 D Data model - abstract client ( 112, 118) server ( 112, 126) Data stream 31 30 31 Data type definitions 35 35 38 42 Valued Parameter 43 45 43 47 41 36 41 27 E 21 Examples 156 134 136 143 146 133 133 153 155 150 151 157 156 158 F 16 state ( 125, 132) 26 G 8
Grammar definition - token description 50 data stream types 31 30 31 data type definitions 35 35 38 42 43 41 36 41 general rules 30 29 27 27 packet data stream headers 33 33 34 48 27 H Higher-layer triggered events client ( 112, 120) server ( 112, 127) I 179 179 21 12 127 Initialization client ( 112, 119) server ( 112, 127) 8 L Local events client ( 117, 125) server ( 117, 132) Logged In state ( 124, 131) 128 134 136 143 146 M Message processing client ( 112, 121) 125 124 121 124 124 121 123 123 122 server ( 112, 127) 131 132 127 131 128 127 130 128 Messages 17 27 17 24 76 21 19 syntax 17 27 17 24 76 50 21 19 17 N 11 O Other local events 125 132 178 13 P 24 Packet data - token stream definition 76 78 79
21 20 19 19 21 20 20 20 132 overview ( 112, 125) sequencing rules ( 112, 127) 131 132 127 131 128 127 130 128 timer events ( 117, 132) timers ( 112, 127) 19 130 178 150 151 18 18 157 156 16 Syntax client messages 19 18 17 18 18 18 18 19 grammar definition for description 50 30 35 27 27 33 48 17 packet data token and tokenless data streams 27 24 25 178 25 packet data stream definition 76 78 79 81 84 85 86 88 91 94 97 98 99 101 102 76 102 103 106 107 108 110 109 packet header message type - stream definition 51 50 166 171 53 64 68 161 71 72 176 72 159 159 packets 21 24 21 server messages 21 21 20 19 19 21 20 20 20 T Timer events client ( 117, 125) server ( 117, 132) Timers client ( 112, 119) server ( 112, 127) 128 data stream 25 token definition 26 25 27 26 26 Token data stream definition