Connect to Database Engine through query

meetjaydeep picture meetjaydeep · May 4, 2011 · Viewed 7.5k times · Source

When you open the SQL Server Management studio you connect to the Database engine through UI.I want same functionality through SQL query e.g. to connect to database we write Use similarly is there any way to connect to database engine.

Answer

Oded picture Oded · May 4, 2011

What you are looking for is not supported - you need to provide the credentials in the Connect to Server dialogue.

There is no way to have a query window open a connection to a database directly.