Home > Class Reference > ENSLIB namespace > %TSQL.SysFunc
Private  Storage   

%TSQL.SysFunc


Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
13


Summary


Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
AddExtendedProperty DBNAME GETDATE HOSTNAME
SPID TRANCOUNT TranslateLF USER
USERID USERNAME VERSION objectid
susername


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 ]
[ @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 ]

Implement DB_NAME()

• classmethod GETDATE() as %String [ SQLProc = GETDATE ]

Implement GETDATE()

• classmethod HOSTNAME() as %String [ SQLProc = HOST_NAME ]

Implement HOST_NAME()

• classmethod SPID() as %String [ SQLProc = SPID ]

Implement @@SPID ("server process identifier")

• classmethod TRANCOUNT() as %String [ SQLProc = TRANCOUNT ]

Implement @@TRANCOUNT

• classmethod TranslateLF(pValue As %String(MAXLEN="")) as %String
• classmethod USER() as %String [ SQLProc = USER ]

Implement USER

DIFFERS BETWEEN 5.0/5.1

• classmethod USERID(UserName As %String) as %Integer [ SQLProc = USER_ID ]

Implement USER_ID(username)

• classmethod USERNAME(UserId As %Integer) as %String [ SQLProc = USER_NAME ]

Implement USER_NAME(userid)

• classmethod VERSION() as %String [ SQLProc = VERSION ]

Implement @@VERSION

• classmethod objectid(ObjectName As %String) as %Integer [ SQLProc = 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 ]

Implement suser_name()

Only the argumentless form is supported