December 2001
Intermediate to advanced
800 pages
17h 55m
English
You'll recall the discussion in Chapter 9 regarding creating our own system views—views that can be queried from any database and run within the context of that database. You can do something similar with system functions. You can create functions that reside in master, but that can be queried from any database without a database name prefix.
Here's how it works: SQL Server creates a number of system UDFs during installation (e.g., fn_varbintohexstr(), fn_chariswhitespace(), and so on). Some of these are owned by the system_function_schema, and some aren't. Those that are owned by system_function_schema can be accessed from any database using a one-part name. You can find out which ones these are by running ...
Read now
Unlock full access