SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Connection


SQL Connection

Author
Message
todd.ayers
todd.ayers
Old Hand
Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)

Group: General Forum Members
Points: 347 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?
Sean Lange
Sean Lange
SSC Guru
SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)

Group: General Forum Members
Points: 65230 Visits: 17979
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 Modens 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)
todd.ayers
todd.ayers
Old Hand
Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)

Group: General Forum Members
Points: 347 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
Sean Lange
Sean Lange
SSC Guru
SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)

Group: General Forum Members
Points: 65230 Visits: 17979
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 Modens 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)
todd.ayers
todd.ayers
Old Hand
Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)

Group: General Forum Members
Points: 347 Visits: 120
How would I connect to those db that are created?
Sean Lange
Sean Lange
SSC Guru
SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)

Group: General Forum Members
Points: 65230 Visits: 17979
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 Modens 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)
mysorian
mysorian
SSC Veteran
SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)

Group: General Forum Members
Points: 226 Visits: 101
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search