sp_add_time_range

Adds a named time range to an SAP ASE server.

Syntax

sp_add_time_range name, startday, endday, starttime, endtime

Parameters

Examples

Usage

There are additional considerations when using sp_add_time_range:
  • The SAP ASE server includes one named time range, the “at all times” time range. This time range covers all times, from the first day through the last of the week, from 00:00 through 23:59. It cannot be modified or deleted.

  • The SAP ASE server generates a unique ID number for each named time range and inserts it into the systimeranges system table,

  • When storing a time range in the systimeranges system table, the SAP ASE server converts its startday and endday values into integers. For servers with a default language of us_english, the week begins on Monday (day 1) and ends on Sunday (day 7).

  • You can create a time range that overlaps with one or more other time ranges.

  • Range days are contiguous, so the days of the week can wrap around the end to the beginning of the week. In other words, Sunday and Monday are contiguous days, as are Tuesday and Wednesday.

  • The active time ranges are bound to a session at the beginning of each query batch. A change in the server’s active time ranges due to a change in actual time has no effect on a session during the processing of a query batch. In other words, if a resource limit restricts a query batch during a given time range but a query batch begins before that time range becomes active, the query batch that is already running is not affected by the resource limit.

  • The addition, modification, and deletion of time ranges using the system procedures does not affect the active time ranges for sessions currently in progress.

  • If a resource limit has a transaction as its scope, and a change occurs in the server’s active time ranges while a transaction is running, the newly active time range does not affect the transaction currently in progress.

  • Changes to a resource limit that has a transaction as its scope does not affect any transactions currently in progress.

  • For more information on time ranges, see the System Administration Guide.

Permissions

The permission checks for sp_add_time_range differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage resource limit privilege.

Disabled

With granular permissions disabled, you must be a user with sso_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_add_resource_limit
sp_drop_time_range
sp_modify_time_range