How to find out which DB is the application pointing to?

  • How can you find out from either DB side or application side, which database is the application pointing to?

    Might be a silly question, but my brain is dead at the moment. lol

    Regards,
    SQLisAwe5oMe.

  • Sometimes the connection string has the database.

  • If you have source code of application you can search for connection string parameters.

    From DB side you can run a SQL Profiler to see against what databases your app is executing queries.

    You also can deny permissions to all the databases for the login that the app is using and then check the error message.


    Alex Suprun

  • You can check the application's .config file, but to know for sure what database servers are accessed by the application, you can query the Default Trace on each instance, filtering on account login name.

    http://www.sqlservercentral.com/articles/SQL+Server+2005/64547/

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Default Trace doesn't capture all the event required to perform the task. If the app connects to the server and runs some very simple queries you may not see anything in the Default Trace.


    Alex Suprun

  • Application may "point to" more than 1 database on more than 1 server.

    Each method may use its own connection string pointing to a database (or any other data source) specific to this method.

    If some developer hardcoded a connection string to a database in a method no content of a config file would indicate that database is actually queried by that method.

    _____________
    Code for TallyGenerator

Viewing 6 posts - 1 through 5 (of 5 total)

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