sp_tsql_environment system procedure

Function

To set connection options when users connect from jConnect or Open Client applications.

Syntax

sp_tsql_environment

Permissions

DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.

Description

If the connection uses the TDS communication protocol (that is, if it is an Open Client connection), sp_login_environment calls sp_tsql_environment.

This procedure sets database options so that they are compatible with default Sybase Adaptive Server Enterprise behavior.

To change the default behavior, create new procedures and alter your LOGIN_PROCEDURE option to point to these new procedures.

For more information about setting LOGIN_PROCEDURE to the name of a new procedure, see Chapter 3, “Sybase IQ as a Data Server” in the System Administration Guide: Volume 2.

Here is the text of sp_tsql_environment:

create procedure dbo.sp_tsql_environment()
begin
if db_property('IQStore') = 'Off' then    -- ASA datastore
set temporary option close_on_endtrans = 'OFF'
end if;
set temporary option ansinull = 'OFF';
set temporary option tsql_variables = 'ON';
set temporary option ansi_blanks = 'ON';
set temporary option chained = 'OFF';
set temporary option quoted_identifier = 'OFF';
set temporary option allow_nulls_by_default = 'OFF';
set temporary option on_tsql_error = 'CONTINUE';
set temporary option isolation_level = '1';
set temporary option date_format = 'YYYY-MM-DD';
set temporary option timestamp_format = 'YYYY-MM-DD
HH:NN:SS.SSS';
set temporary option time_format = 'HH:NN:SS.SSS';
set temporary option date_order = 'MDY';
set temporary option escape_character = 'OFF'
end

See also

LOGIN_PROCEDURE option in Chapter 2, “Database Options,” in Reference: Statements and Options