Specifies a login procedure that sets connection compatibility options at start-up.
Can be set for an individual connection or the PUBLIC group. Requires DBA permissions to set the option. Takes effect immediately.
The initial connection compatibility options settings are controlled using the LOGIN_PROCEDURE option, which is called after all the checks have been performed to verify that the connection is valid. The LOGIN_PROCEDURE option names a stored procedure to run when users connect. The default setting is to use the sp_login_environment system stored procedure. You can specify a different stored procedure. The procedure specified by the LOGIN_PROCEDURE option is not executed for event connections.
The sp_login_environment procedure checks to see if the connection is being made over TDS. If the connection is made over TDS, sp_login_environment calls the sp_tsql_environment procedure, which sets several options to new default values for the current connection.