2.2.6.3 LOGIN

Stream Name

 LOGIN

Stream Function

Defines the login record rules for use with SQL Server.

Stream Comments

  • The packet header type is 0x02.

  • The length of a LOGIN record needs to be larger than 563 bytes and needs to be smaller than 573 bytes.

Stream-Specific Rules

 HostName       =   30BYTE
 cbHostName     =   BYTE
 UserName       =   30BYTE
 cbUserName     =   BYTE
 Password       =   30BYTE
 cbPassword     =   BYTE
 HostProc       =   8BYTE
 cbHostProc     =   BYTE
 AppType        =   6BYTE
 lInt2          =   BYTE
 lInt4          =   BYTE
 lChar          =   BYTE
 lFloat         =   BYTE
 lUseDB         =   BYTE
 lDumpLoad      =   BYTE
 lInterface     =   BYTE
 lType          =   BYTE
 lDBLIDFlags    =   BYTE
 AppName        =   30BYTE
 cbAppName      =   BYTE
 ServerName     =   30BYTE
 cbServerName   =  BYTE
 RemotePassword =  255BYTE
 cbRemotePassword = BYTE
 TDSVersion     =  DWORD
 ProgName       =  10BYTE
 cbProgName     =  BYTE
 ProgVersion    =  DWORD
 Language       =  30BYTE
 cbLanguage     =  BYTE
 SetLanguage    =  BYTE
 PacketSize     =  6BYTE
 cbPacketSize   =  BYTE
 Padding        =  *8BYTE

Stream Definition

 LOGIN            =   HostName
                      cbHostName
                      UserName
                      cbUserName
                      Password
                      cbPassword
                      HostProc
                      16FRESERVEDBYTE
                      AppType
                      cbHostProc
                      lInt2
                      lInt4
                      lChar
                      lFloat
                      FRESERVEDBYTE
                      lUseDB
                      lDumpLoad
                      lInterface
                      lType
                      6FRESERVEDBYTE
                      lDBLIBFlags
                      AppName
                      cbAppName
                      ServerName
                      cbServerName
                      RemotePassword
                      cbRemotePassword
                      TDSVersion
                      ProgName
                      cbProgName
                      ProgVersion
                      3FRESERVEDBYTE
                      Language
                      cbLanguage
                      SetLang
                      45FRESERVEDBYTE
                      PacketSize
                      cbPacketSize
                      Padding

Stream Parameter Details

Stream parameter details are described in the following table.

Parameter

Description

HostName

Name of the host.

UserName

The user ID used to validate access to the server.

Password

The password used to validate access to the server.

HostProc

The host process identification in hex format.

AppType

The unique client ID, for example: MAC address for the client machine.

lInt2

The byte order for all integer values exchanged between the client and the server unless otherwise specified.

  • 2      The first byte is the most significant byte (680x0), big-endian

  • 3      The first byte is the least significant byte (VAX, 80x86), little-endian

lInt4

The type of int4 for the client. The server ought to ignore this field.

lChar

The character set used on the client:

  • 6      CHARSET_ASCII

  • 7      CHARSET_EBCDIC

lFloat

The type of floating point representation used by the client.

  • 5      FLOAT_VAX

  • 10    FLOAT_IEEE_754

  • 11    ND5000

lUseDB

Set if the client desires warning messages on execution of the USE SQL statement. If this flag is not set, the client is not informed when the database changes.

  • 0      USE_DB_OFF

  • 1      USE_DB_ON

lDumpLoad

Set if dump/load or BCP capabilities are needed by the client.

  • 0      DUMPLOAD_ON

  • 1      DUMPLOAD_OFF

lInterface

The type of SQL language that the client will send to the server. Only 0 and 1 are supported by SQL Server.

  • 0      LDEFSQL (Default language. For SQL Server; that is, Transact-SQL)

  • 1      LXSQL (Explicitly referencing Transact-SQL)

lType

The source of the connection.

  • 0      Normal user connecting directly.

  • 2      User login through another server.

  • 4      Replication login.

  • 8      Integrated security user login. If this type is used, USERNAME and PASSWORD MUST be ignored.

lDBLIBFlags

Indicates whether SSPI negotiation is required.

  • 0x01     SSPI negotiation is required.

AppName

The name of the application.

ServerName

The network name for the server the client is connecting to.

RemotePassword

Remote password. The server ought to ignore the field.

TDSVersion

The TDS version of the client. For TDS 4.2, the value is 0x04020000 and is sent as big-endian.

The value ought to be ignored by the server. If the following two conditions are met, TDS 4.2 ought to be used for communication between the client and the server:

  • The packet header of the LOGIN data stream is 0x02.

  • The lowest byte of ProgVersion is greater than or equal to 0x06.

ProgName

The name of the client program.

ProgVersion

The version of the client program.

Language

The name of the initial language to be used once login is complete.

SetLang

A flag to request notification of language changes.

  • 0 = SET_LANG_OFF

  • 1 = SET_LANG_ON

PacketSize

The desired packet size being requested by the client.

Padding

Padding data to the login record. The number of bytes can be any number between 0 and 8. The server ought to ignore this field.

Login Data Validation Rules

All fields except Padding have a fixed length. Each data field has a corresponding length field that indicates how many bytes of the data field are to be used. For example, cbHostName indicates how many bytes of HostName are to be used. The remaining bytes of the data field are to be ignored.