• As the last post showed, @@ServerName gets you the name of the server, DB_NAME() gets you the current database. If you pass it a database ID, it will get any other database name.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning