
Invoking Methods or Retrieving Properties of User-defined Types
You can invoke a method or retrieve a property of a user-defined type anywhere that a scalar expression can appear. You must have EXECUTE permission on the type. Methods that change the state of data outside an UPDATE statement will be executed, but the changes will be ignored because mutable methods are not allowed in queries.
Strings that are returned by user-defined type methods assume the collation of the database in which the user-defined type was created, regardless of the current database.
Caution: |
|---|
|
Methods and properties that are used in SELECT statements must not have side effects. If a method used in a SELECT statement has side effects, the results are not deterministic.
|
Caution: |
|---|
|
When method or property invocations occur against user-defined types over which computed columns are created and the invocation occurs in the context of an operation on the computed column, EXECUTE permissions on the type are not checked. Instead, permissions are checked when the computed column is created.
|
To invoke a method or retrieve a property of a user-defined type
Note: |
|---|
|
SQL Server Management Studio returns user-defined type values in binary representation. To return user-defined type values in string or XML format, use CAST or CONVERT.
|