dbTalk Databases Forums  

test connection to a database without specifying a database

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss test connection to a database without specifying a database in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony
 
Posts: n/a

Default test connection to a database without specifying a database - 11-15-2011 , 07:25 AM






Hello!

I do the following.
1.Right click on Data Connection in Server Explorer and choose Add
connection
2. In the Data Source I select Microsoft SQL Server (SqlClient)
3.In server name I enter localhost
4. I select Use Window Authentication
5. I click on Test Connection and the result is Test connection succeeded

Now to my question I really don't understand how this is possible to test a
connection
without specifying any database ?
Can somebody explain that.

//Tony

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: test connection to a database without specifying a database - 11-15-2011 , 08:12 AM






Tony (johansson.andersson (AT) telia (DOT) com) writes:
Quote:
I do the following.
1.Right click on Data Connection in Server Explorer and choose Add
connection
2. In the Data Source I select Microsoft SQL Server (SqlClient)
3.In server name I enter localhost
4. I select Use Window Authentication
5. I click on Test Connection and the result is Test connection succeeded

Now to my question I really don't understand how this is possible to test
a
connection
without specifying any database ?
Can somebody explain that.
This is because that SQL Server stores a default database for you, which you
will be connected to if you do not specify a database. By default this
default database is the master database.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
Tony
 
Posts: n/a

Default Re: test connection to a database without specifying a database - 11-15-2011 , 08:14 AM



Good explained!!

//Tony


"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> skrev i meddelandet
news:Xns9F9E9AB5A976Yazorman (AT) 127 (DOT) 0.0.1...
Quote:
Tony (johansson.andersson (AT) telia (DOT) com) writes:
I do the following.
1.Right click on Data Connection in Server Explorer and choose Add
connection
2. In the Data Source I select Microsoft SQL Server (SqlClient)
3.In server name I enter localhost
4. I select Use Window Authentication
5. I click on Test Connection and the result is Test connection succeeded

Now to my question I really don't understand how this is possible to test
a
connection
without specifying any database ?
Can somebody explain that.

This is because that SQL Server stores a default database for you, which
you
will be connected to if you do not specify a database. By default this
default database is the master database.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #4  
Old   
Bob Barrows
 
Posts: n/a

Default Re: test connection to a database without specifying a database - 11-15-2011 , 08:15 AM



Tony wrote:
Quote:
Hello!

I do the following.
1.Right click on Data Connection in Server Explorer and choose Add
connection
2. In the Data Source I select Microsoft SQL Server (SqlClient)
3.In server name I enter localhost
4. I select Use Window Authentication
5. I click on Test Connection and the result is Test connection
succeeded

Now to my question I really don't understand how this is possible to
test a connection
without specifying any database ?
Can somebody explain that.

It uses the default database for the login (every login has a default
database that defaults to master if none is chosen when the login is
created)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.