how to get current db in query analiser?

  • example

    declare @curent_db varchar(255)

    select @curent_db=???

    execute_sql "selec * from  " + @curent_db + ".dbo.sales "

     

     

  • This isn't really the right forum for this question but...

    SELECT DB_NAME()

    -----
    JL

  • Good  thank  , bien gracias , tratare de buscar bien el for

  • As James pointed out, this really isn't the proper forum. The Question of the Day (QOD) forum is is strictly for discussing the Question of the Day. The QOD is a daily 'test' question that can be found at Resourses>Question of the Day.

    Just wanted to let you know.

    -SQLBill

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply