I know mysql, and I'd like to learn sqlserver.
I'm currently stuck on the basics of basics:
How to install and configure sql server
How to connect to it
I installed Sql Server through Web Platform Installer, and have Visual Studio 2008 installed. Still, I can't understand how to connect to my server:
I see that the SQL service itself (SQLEXPRESS) is running in both in services.msc and Sql Server Configuration Manager
I try to connect to it via the Management Studio, but I don't understand what to do.
Where do I begin?
Start Management Studio and Select Database Engine as your SqlExpress instance then choose Windows Authentication and press connect. After that in object explorer you will see your databases if you want to create one right click databases and create new one.
You can look at http://msdn.microsoft.com/en-us/library/ms186312.aspx
There are two types of ways you can install a SQL Server instance:
1. Named Instance
2. Default Instance
When you use the default instance, and it's the only instance on the machine, the server would listen directly on the port 1433 which is the default SQL Server port. This is what you'd expect if you come from a mysql background.
When you "name" an instance, such as SQLEXPRESS, it works differently. You connect to a special service (SQL Server Browser Service) which now listens on that port, and points the client to the "correct" port of the named instance. I hope I'm being accurate about this one, but that's what happens in general.
You could connect directly to the named instance if you see what port it binds to in the SQL Server error log, and if you could choose the port in the client application.
Read more about this here: http://msdn.microsoft.com/en-us/library/ms181087.aspx
Related
I'm attempting to connect to an instance of SQL Server 2008 (Developer Edition) in SQL Server Management Studio but am receiving the following error:
In SQL Server Configuraton Manager, all services are running and logged in as LocalSystem.
I have set the SQL Native client 10.0 configutarion to enable Shared Memory, TCP/IP, and Named Pipes. I have also set SQL Serer Network Configuration to enable Shared Memory.
The default (unnamed) instance uses MSSQLSERVER as its service name - so it seems your instance is actually called MSSQLSERVER08.
Therefore, you need to use
.\MSSQLSERVER08
or
(local)\MSSQLSERVER08
as your server name for connecting...
Note:
all these things refer to the local machine in the context of connecting to a SQL Server installed on that machine:
.
(local)
localhost
or your actual machine name (whatever it might be)
For SQL Express use .\MSSQLSERVER08 as your server name. Try to enable TCP/IP, Shared Memory and Named Pipes from all programs
Also check if the service is started:
Restart the SQL Server services. Then try to connect.
OR
If you have Installed SQL server with named instance, browse for for the server name.
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.
Instead of giving:
./SQLEXPRESS //in the Server Name
I put this:
.\SQLEXPRESS //which solved my problem
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.
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.
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
by default -
you can also log in to sql express using server name as:
./SQLEXPRESS
or log in to sql server simply as
.
This was provided after installation of Sql Express 2019
Server=localhost\SQLEXPRESS;Database=master;Trusted_Connection=True;
So just use 'localhost\SQLEXPRESS' in server name and windows authentication worked for me.
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).
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
I am not able to connect to a SQL Server 2005 hosted on a Win7 virtual machine. I am new to VM, can someone help me locate the problem?
I am able to connect another SQL server which is installed on the local machine.
When you say you can't connect - that can mean a lot of things - really you need to be much more specific.
In addition to the comments and answers already here - If you're having trouble connecting to it in Sql Server Management Studio - you should open Configuration Manager on the VM itself and make sure that Shared Memory and Named Pipes are enabled (open the SQL Server Network Configuration node in the tree).
For example, SQL Server Express instances are configured by default to reject the kind of remote connection that SSMS wants to open by default.
first of all check your connection string (for reference):
http://www.connectionstrings.com/
Second you need to add an exception in the guest machine firewall or completely disable it (port 1433 is for sql tcp/ip access).
this works fine for me:
SQLConn.ConnectionString = "Network Library=DBMSSOCN; Data Source=xxx.xxx.xxx.xxx,1433;
Initial Catalog=mySQLServerDBName; User ID=myUsername;Password=myPassword"
good luck
I'm trying to add new data source via the data source configuration wizard. I'm using Microsoft SQL Server as data source and .NET framework Data Provider for SQL Server as data provider. In the next window where I have to choose the server name, the list is empty. So I thought one of the SQL services are not working, I opened services.msc and there were 6 services, from which only SQL services vss writer was enabled. I enabled all of them (SQL Server, SQL Server agent, SQL Server browser, SQL Server Active Directory Helper) but the list still is empty. What should I do?
The SQL Browser service is the one used to allow other machines to discover the SQL server's existence on the network, though this requires TCP/IP or Named Pipes to be enabled in the SQL configuration, so check that too.
Also check your firewall isn't blocking the UDP port 1434 (and TCP port 1433 for that matter) [note, these are the default ports; they can be changed in the configuration).
The problem here might be your Database might not have permission over network..
Just try to connect by using Sql Authentication using sa account and password.. This should help you.
The other reason might be if you are using Visual studio 2010 it wont show database from Sql Server 2000
Accept or Vote up if it works for you.
I am having a hell of a time trying to connect to the SQL SERVER 2005 database. I am using Windows 7.
Here is the screenshot of the error thrown:
(source: highoncoding.com)
I have been battling this issue for the past week and still no progress.
I have tried the following in the server name:
(local)
localhost
computername
none of them worked!
I just checked in the services section and SQLSERVER EXPRESS is not even there. I am using the following post as a reference:
https://serverfault.com/questions/11745/i-cannot-connect-to-my-local-sql-server-2008
This instance of SQL Server is running on the same PC you're connecting from? That's the implication of 'local'.
Possibilities :
1) Try (local) instead of local for the server name
2) Try 'MSSQLSERVER' as the name
3) Check the SQL Server Configuration Manager shows the same configuration options you're attempting to connect with, eg the same instance name, Named Pipes enabled, services running ok, etc.
EDIT :
Ok, what are you using to connect with? SQL Server Management Studio Express? Are you sure you installed an instance? The lack of SQLExpress in the services list would seem to indicate otherwise.
When you connect to a SQL Server you specify the name in the form {computername}\{instancename}. The {instancename} is the name of the SQL instance which was chosen during the SQL Server installation. For {computername} you can substitute the special names . or local when connecting to the localhost machine. If the SQL Server was installed as the Default instance then the instance name part must be omitted, so the connection Server name becomes just the computer name.
SQL Server Express installs by default an instance named SQLEXPRESS. The corresponding NT service name is MSSQL$SQLEXPRESS. The Server name in the connection dialog is .\SQLEXPRESS, local\SQLEXPRESS, localhost\SQLEXPRESS or {computername}\SQLEXPRESS (they're all the same).
If the SQL Server was installed as the Default instance name then the corresponding NT service name is MSSQLSERVER. The Server name in the connection dialog is ., local, localhost or {computername} (they're all the same).
If the SQL Server was installed as a named instance then the corresponding NT service name is MSSQL${INSTANCENAME}. The Server name in the connection dialog is .\{INSTANCENAME}, local\{INSTANCENAME}, localhost\{INSTANCENAME} or {computername}\{INSTANCENAME} (they're all the same).
When connecting from a remote computer to a SQL Server instance the SQL has to be configured to allow remote connection How to configure SQL Server 2005 to allow remote connections.
Check your SQL server configuration, make sure the TCP connections are enabled. You can also check that the SQL Browser service is started. Make sure you do not have a firewall that gets on the way. Make sure the SQL Server service is also started.
Did you install SQL Server on the default instance, or have you used named instances? If you've used named instances then the server will be server\instancename. If you don't know, then have a look in the Services administrative tool; you'll be able to determine the instance name, if any, from there).
You could also try connecting with the server name as a single period (i.e. simply ".") [caveat... I've not got access to SQL Server at the moment, but I think I've used this before now].