System Functions
System functions provide information at a system level.
Table 58
Examples
The following examples show how to obtain the name of the current user and database:
SELECT USER()
SELECT DATABASE()
============ 
The following example creates a column of data type UNIQUEIDENTIFIER as the first column in new table "table1." Setting a default value with the NEWID function provides a unique value for "col1" in each new row within the table.
CREATE TABLE table1 (col1 UNIQUEIDENTIFIER DEFAULT NEWID() NOT NULL, col2 INTEGER)
INSERT INTO table1 (col2) VALUES (1)
INSERT INTO table1 (col2) VALUES (2)
INSERT INTO table1 (col2) VALUES (3)