System-Wide Table Valued Functions

In addition to the built-in scalar functions, SQL Server 2000 now provides a set of system-wide table-valued functions that can be invoked from any database. Usually, when you invoke a user-defined table-valued function that is not local to the current database context, you have to fully qualify the function name with the database name. This is not required for system-wide table-valued functions. A special syntax is used to invoke system-wide table-valued funcions. You must precede the function name with two colons (::), as shown in the following example:

 SELECT * FROM ::fn_virtualfilestats(5, 1) go DbId FileId TimeStamp NumberReads NumberWrites BytesRead BytesWritten IoStallMS ---- ------ --------- ----------- ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.