Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Connection Expand / Collapse
Author
Message
Posted Thursday, May 02, 2013 12:40 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
I just had sql server 2012 installed on my local machine but after typing my code I clicked on the execute button to test it but I am not connected to any db server. I'm sure this is a dumb question but I'm a noob..... dont I have to be connected to a db in order to test what I create or build a new db?
Post #1448950
Posted Thursday, May 02, 2013 12:44 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:28 PM
Points: 12,034, Visits: 11,062
todd.ayers (5/2/2013)
I just had sql server 2012 installed on my local machine but after typing my code I clicked on the execute button to test it but I am not connected to any db server. I'm sure this is a dumb question but I'm a noob..... dont I have to be connected to a db in order to test what I create or build a new db?


Yes if you are creating some sql script you have to be connected to a DB in order to execute the script. You can right click in the query window then Connection -> connect


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1448951
Posted Thursday, May 02, 2013 12:51 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
ok I thought so, but I am having another DBA tell me that there have to be data bases built before those tools will connect to them
Post #1448953
Posted Thursday, May 02, 2013 1:03 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:28 PM
Points: 12,034, Visits: 11,062
todd.ayers (5/2/2013)
ok I thought so, but I am having another DBA tell me that there have to be data bases built before those tools will connect to them


Yes that is true. The connection there is making a connection to a database. If there is no database it is not possible to connect to it.

When you install SQL server there are a few databases that are generated.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1448954
Posted Thursday, May 02, 2013 1:06 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
How would I connect to those db that are created?
Post #1448956
Posted Thursday, May 02, 2013 1:14 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:28 PM
Points: 12,034, Visits: 11,062
todd.ayers (5/2/2013)
How would I connect to those db that are created?


Well technically you don't connect to a database, you connect to an instance of SQL Server. Then from that connection you can use any database that you have access to.

Assuming you have no other instances on your machine, and it is on your machine you just connect to the server. In the server name you would put (local) including the parenthesis.

Then depending on how you setup authentication you will either use windows Authentication or SQL Server Authentication. Then you will have Master, Model, msdb, tempdb. If you installed Reporting Services you will have a couple of databases for that as well.



_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1448957
Posted Monday, June 10, 2013 2:00 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, December 26, 2013 2:15 PM
Points: 39, Visits: 75
If you are writing code, the first thing you test for your self is whether you can connect to the server. Technically even if user created databases are not present, the system databases will always be there.

Read this article I wrote on connecting to SQL Server:
http://www.codeproject.com/Articles/8157/ADO-NET-101-SQL-Connection

If you are connecting through a client such as SQL Server Management Studio then if you can bring up the SSMS Screen then go to FILE and click to connect to Object Explorer. You get a window Connect to Server and there you click on the handle to see all available connected servers.

You can find many more articles in my blogs: http://hodentek.blogspot.com
Post #1461761
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse