May 2, 2013 at 12:40 pm
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?
May 2, 2013 at 12:44 pm
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 http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 2, 2013 at 12:51 pm
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
May 2, 2013 at 1:03 pm
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 http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 2, 2013 at 1:06 pm
How would I connect to those db that are created?
May 2, 2013 at 1:14 pm
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 http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
June 10, 2013 at 2:00 pm
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
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply