Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Location
    Canada
    Posts
    45

    Unanswered: name of current database

    I want to know the name of current database

    for make something like that

    DECLARE @db_name varchar(100)

    SET @db_name = [the name of current database]
    USE master
    ...
    ...
    USE @db_name


  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    a quick search of BOL reveiled db_name().
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •