SQL Server Performance

What is the recommended way to switch to another database?

Discussion in 'SQL Server 2005 General Developer Questions' started by pcsql, Sep 21, 2007.

  1. pcsql New Member

    If I have already made a connection to a database, now I want to use another database. Should I issue the "Use" statement or disconnect the current connection and make a new connection to another database? The reason I asked about this is because if I issue "Use" statement, I don't know whether the connection string of the .NET connection object will show the original database or the new database.
  2. DilliGrg Member

    "Use DatabaseName" will do that. Also the question of if your .NET connection object will show the original or the new database; if the connection is successful then you know that it's using the right database, right?
  3. pcsql New Member

    Hi DilliGrg,
    I just wonder if I check the value of the connection string in .Net Application, it will show the old or new database. I think the connection string will still show the original database.
  4. DilliGrg Member

    Try yourself. [:)]

Share This Page