Connecting to SQL Server Express - What is my server name?

强颜欢笑 提交于 2019-12-09 05:02:40

问题


I was just given a laptop to perform some development from a client and I am currently in the process of setting it up. Visual Studio 2010 is installed as well as SQL Server Management Studio 2008 R2. I'm trying to open SQL Server Management Studio to connect to the database but so far am not having much luck. I'm used typing in for a server name something like...

localhost
(local)
SQLEXPRESS

None of these are working.

So my question is: How can I tell what type of SQL Server installation and configuration I have on this machine, and how can I discover what server name I need to use in order to properly connect to it?

--Addition--------------------------------------------

I looked into the services as directed and found a few instances as indicated. SQLEXPRESS and MSSQLSERVER. I have tried to login with both of those options in these configurations...

SQLEXPRESS
MSSQLSERVER
computername\SQLEXPRESS
computername\MSSQLSERVER
.\SQLEXPRESS
.\MSSQLSERVER

None of these worked. I also altered the 'Log On As' property of the services from 'Network Service' to 'Local System' and tried them again. Still no success.


回答1:


You should be able to see it in the Services panel. Look for a servicename like Sql Server (MSSQLSERVER). The name in the parentheses is your instance name.




回答2:


Instead of giving:

./SQLEXPRESS //in the Server Name

I put this:

.\SQLEXPRESS //which solved my problem



回答3:


If sql server is installed on your machine, you should check

Programs -> Microsoft SQL Server 20XX -> Configuration Tools -> SQL Server Configuration Manager -> SQL Server Services You'll see "SQL Server (MSSQLSERVER)"

Programs -> Microsoft SQL Server 20XX -> Configuration Tools -> SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for MSSQLSERVER -> TCP/IP Make sure it's using port number 1433

If you want to see if the port is open and listening try this from your command prompt... telnet 127.0.0.1 1433

And yes, SQL Express installs use localhost\SQLEXPRESS as the instance name by default.




回答4:


Sometimes none of these would work for me. So I used to create a new web project in VS and select Authorization as "Individual User Accounts". I believe this work with some higher version of .NET Framework or something. But when you do this it will have your connection details. Mostly something like this

(LocalDb)\MSSQLLocalDB



回答5:


by default -

you can also log in to sql express using server name as:

./SQLEXPRESS

or log in to sql server simply as

.



回答6:


Similar to what StuartLC was saying, my problem was not resolved until I enabled TCP/IP protocol under SQL Network Configuration>>Protocols for MSSQLSERVER in the SQL Server Configuration Manager dialogue box. After enabling this and a restart, my SSMS connected right away with just the instance name (no ~\MSSQLSERVER).




回答7:


All of the following services should be running,for successful connectivity: SQL Full test filter Daemon, SQL server(SQLEXPRESS), SQL Server Agent(SQLEXPRESS), SQL Server Browser, SQL server reporting service and SQL Server VSS Writer



来源:https://stackoverflow.com/questions/11425275/connecting-to-sql-server-express-what-is-my-server-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!