Skip to main content

%TSQL.SysFunc

Method Inventory

Methods

classmethod AddExtendedProperty(name As %String(MAXLEN=256)="", value As %String(MAXLEN=7500), level0type As %String(MAXLEN=256), level0name As %String(MAXLEN=256)="", level1type As %String(MAXLEN=256), level1name As %String(MAXLEN=256)="", level2type As %String(MAXLEN=256), level2name As %String(MAXLEN=256)="") as %Integer [ SQLProc = sp_addextendedproperty ]
Projected as the stored procedure: sp_addextendedproperty
[ @name ] = { 'property_name' } Is the name of the property to be added. property_name is sysname and cannot be NULL. Names can also include blank or non-alphanumeric character strings, and binary values. [ @value= ] { 'value'} Is the value to be associated with the property. value is sql_variant, with a default of NULL. The size of value cannot be more than 7,500 bytes. [ @level0type= ] { 'level0_object_type' } Is the type of level 0 object. level0_object_type is varchar(128), with a default of NULL. Valid inputs are ASSEMBLY, CONTRACT, EVENT NOTIFICATION, FILEGROUP, MESSAGE TYPE, PARTITION FUNCTION, PARTITION SCHEME, REMOTE SERVICE BINDING, ROUTE, SCHEMA, SERVICE, USER, TRIGGER, TYPE, and NULL. Important The ability to specify USER as a level 0 type in an extended property of a level 1 type object will be removed in a future version of SQL Server. Use SCHEMA as the level 0 type instead. For example, when defining an extended property on a table, specify the schema of the table instead of a user name. The ability to specify TYPE as level-0 type will be removed in a future version of SQL Server. For TYPE, use SCHEMA as the level 0 type and TYPE as the level 1 type. [ @level0name= ] { 'level0_object_name' } Is the name of the level 0 object type specified. level0_object_name is sysname with a default of NULL. [ @level1type= ] { 'level1_object_type' } Is the type of level 1 object. level1_object_type is varchar(128), with a default of NULL. Valid inputs are AGGREGATE, DEFAULT, FUNCTION, LOGICAL FILE NAME, PROCEDURE, QUEUE, RULE, SYNONYM, TABLE, TABLE_TYPE, TYPE, VIEW, XML SCHEMA COLLECTION, and NULL. [ @level1name= ] { 'level1_object_name' } Is the name of the level 1 object type specified. level1_object_name is sysname, with a default of NULL. [ @level2type= ] { 'level2_object_type' } Is the type of level 2 object. level2_object_type is varchar(128), with a default of NULL. Valid inputs are COLUMN, CONSTRAINT, EVENT NOTIFICATION, INDEX, PARAMETER, TRIGGER, and NULL. [ @level2name= ] { 'level2_object_name' } Is the name of the level 2 object type specified. level2_object_name is sysname, with a default of NULL. Return Code Values 0 (success) or 1 (failure)
classmethod DBNAME() as %String [ SQLProc = DB_NAME ]
Projected as the stored procedure: DB_NAME

Implement DB_NAME()

classmethod GETDATE() as %String [ SQLProc = GETDATE ]
Projected as the stored procedure: GETDATE

Implement GETDATE()

classmethod HOSTNAME() as %String [ SQLProc = HOST_NAME ]
Projected as the stored procedure: HOST_NAME

Implement HOST_NAME()

classmethod SPID() as %String [ SQLProc = SPID ]
Projected as the stored procedure: SPID

Implement @@SPID ("server process identifier")

classmethod TRANCOUNT() as %String [ SQLProc = TRANCOUNT ]
Projected as the stored procedure: TRANCOUNT

Implement @@TRANCOUNT

classmethod TranslateLF(pValue As %String(MAXLEN="")) as %String
classmethod USER() as %String [ SQLProc = USER ]
Projected as the stored procedure: USER

Implement USER

DIFFERS BETWEEN 5.0/5.1

classmethod USERID(UserName As %String) as %Integer [ SQLProc = USER_ID ]
Projected as the stored procedure: USER_ID

Implement USER_ID(username)

classmethod USERNAME(UserId As %Integer) as %String [ SQLProc = USER_NAME ]
Projected as the stored procedure: USER_NAME

Implement USER_NAME(userid)

classmethod VERSION() as %String [ SQLProc = VERSION ]
Projected as the stored procedure: VERSION

Implement @@VERSION

classmethod objectid(ObjectName As %String) as %Integer [ SQLProc = object_id ]
Projected as the stored procedure: object_id

Implement object_id(objectname)

Only the use as a predicate is supported :-

  • returns 1 if ObjectName is the name of an existing table, view or stored procedure

  • returns NULL ("") otherwise

classmethod susername() as %String [ SQLProc = suser_name ]
Projected as the stored procedure: suser_name

Implement suser_name()

Only the argumentless form is supported

Inherited Members

Inherited Methods

FeedbackOpens in a new tab