SQL Server 2008 R2 First Time Login - sql

I've just started work on a new computer in which I had to download all the software fresh.
I've just download a copy of SQL Server 2008 R2, and I'm trying to connect to SQL Server Management Studio without success. I vaguely remember last time I installed this, it asked me to choose between windows, or sql server authentication, however this didn't happen for this installation.
If I try to login via Windows Authentication (where the username and password fields are greyed out, localhost as server name) it gives the following error:
"A Network-related or instance
specific error occured while
establishing a connection to SQL
Server. The server was not found or
was not accessible. Verify that the
instance name is correct and that SQL
Server is configured to allow remote
connections. (provider: Named Pipes
Provider, error: 40 - Could not open a
connection to SQL Server) (Microsoft
SQL Server, Error: 2)"
I have checked everything in SQL Server Configuration Manager, and everything bar VIA is enabled.
If I try SQL Server Authentication, It asks me for a username and password which I definiately have not set yet. Also, under SQL Server Services in configuration manager, there is nothing there.
Any help would be appreciated :)
Thanks
PS: I don't know if it's worth mentioning but I am running Windows 7 as a virtual machine on a Mac.

Are you sure you have the correct instance name? If it was SQL Server 2008 R2 Express Edition then the default instance name is .\SQLEXPRESS.
Also if your using sql authentication to connect try running sql management studio as admin, if you are a limited user your identity might not be mapped to an account in sql server yet but i believe the Administrators user group is.

You need to check if your services are running.
Please type
net start mssqlserver
in your command prompt. Then try to login.

Ended up reinstalling completely and doing a fresh install from a fresh download. When I did this I was brought through the steps of selecting the default instance, and selecting authentication modes.
Working fine now :)

After checking tons of sites looking for an answer to this question, I think I have a simple solution.
Open the sql Server Configuration
Click on the sql server services node
Right Click on Sql server
Click Start.
I have been screwing around with this forever, and this simple method actually worked.

Related

SQL server Login Fail for user 'ROMANCH9326/romanch'

I installed SQL server 2012 developer addition.
My windows is working on Parallel Access installed on MAC.
When I tried opening SQL server, It initiated a call to connect to server. And when I clicked on connect it gave me error.
I've never installed SQL server 2012 in my personal PC. WHen I was installing I chose Windows authentication mode and user ROMANCH9326 came out automatically.
Please help me, I'm clueless about this problem.
TITLE: Connect to Server
Cannot connect to ROMANCH9326.
ADDITIONAL INFORMATION:
Login failed for user 'ROMANCH9326\romanch'. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
On Start > Search type "sql configuration"
Open SQL Configuration Manager
SQL Server Network Configuration >Protocols for [SQLINSTANCENAME]
Check if Named Pipes is enabled, enable it if not.
Restart your SQL Server Instance.
Well This is a pretty silly solution but when I tried repair function on SQL server it said that my Database Engine libraries were not installed properly somehow.
So I reinstalled the software and now it worked just fine. I was able to log in.
Thanks :)

Connecting to a SQL Server with SQL Server Managament Studio

I have looked everywhere on Stack Overflow and I have not found an answer that closely compares to my scenario, so please bear with me.
The issue is I was recently given a development server at work and I have to migrate my current project (which I have on SQL Server Management Studio running on SQL Server Express) so that it is hosted on that server. I was just given the server name and authorized access to it. So I can connect to it through Remote Desktop Connection (RDC), but I am clueless as to where to go from here.
I have tried going in through RDC and opening Management Studio from there but when plugging in my server name and using Windows Authentication it doesn't let me in. And I can't use SQL Server Authentication because I'd have to be actually in to be able to create an SQL login.
How can I connect to this server through Management Studio?
The server is in the same network? In the management studio, in server name, you can put a IP address or computer name.
Do you know if SQL is even installed on the server you are tasked to deploy to? You are able to "connect" to SQL Express locally because the instance is installed on your local machine. You will need an instance of SQL installed on the remote machine to be able to use SSMS to connect to the remote instance.
If you are attempting to connect to an already created DB that you have been using the credentials are the same, if you know the address and you have the ports opened on your computer to allow the connection. If you are going to start a new DB on the server, then you will have to connect via AD credentials IF your admin has given you the proper access. I personally suggest using AD credentials to create connections, it's just a lot more secure.
If you are trying to connect to the local db, then it should be on the drop down list on the log in screen.
You are going to have to talk with your admin who set it up if you are still having problems.
You might have to Enter your Server Details in the Hosts File on the Current Application Server
For Accessing Hosts File,
Go to Run and type drivers and Hit Enter. Go to the etc Folder and you will see hosts file in the Folder.
At the End of the File Enter the Server IP And Server Name
Save the file and try Logging into the Server Management Studio again
Hopefull, this would help

Cannot login to sql server 2008 R2 after rebooting server

I am using Windows-server-2008 with Microsoft SQL Server 2008.
And there are a lot of questions about this, but nothing on the internet solved it.
The problem is that i can't connect to the my SQL Server 2008 R2 after rebooting my server.
I placed some new memory in my server, and after rebooting my client/server application didn't work anymore because it cannot reach the database.
So i tried to get in SQL Server Management Studio (SSMS), and tried to loggin with Administrator and another user but both do not work.
When i logg in the following message is displayed:
Cannot connect to (local)
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
(Microsoft SQL Server, Error: 2)
I Tried a lot of different things like:
Rebooting server
Try to start the server manually from Sql Server Configuration Manager
Named Pipes - Enabled
TCP/IP - Enabled
Tried to create an new system user or database user as described in the following article: Click Here
Can somebody please help me? I am really confused because i need to get this online. Otherwise i have to reinstall the database server but i do not have a back-up. (is there some folder with a back-up of the settings/tables/columns are stored and can be imported from reinstall?
I was having the exact same problem. net start mssqlserver was giving me the blurb about a failed login attempt. The problem was that I had recently changed the password for the administrator account, and the new password didn't get updated in services.
Here's how I fixed it:
First locate SQL Server from the list here:
Right click and select properties, and navigate to the Log On tab:
Then I typed the new password, and like magic I was able to start SQL Server right through the services manager.
I also did this for any other processes which were marked as "stopped" even though Startup Type was marked as "automatic" (namely, SQL Server Agent).
Is it a named instance or default? Also, is this a local instance? (I see the "(local)" but just wanted to make sure.)
Start the sql server services from services.msc and try to connect

Connect LINQPad to remote SQL Server

Disclaimer: I understand the question is very basic, but I could not find the answer in Google or here, and can not do it myself with guessed configuration.
I want to get started with LINQPad and I have a SQL Server 2005 installed on different machine in the same domain. But I can not connect to that server from LINQPad.
Here is the screenshot:
What do I put as a Server string?
Many thanks in advance!
Update 1: SERVERNAME\MSSQLSERVER does make a difference. Instead of Error
26 (Can not find server instance)
I get error
25 (Connection string is not correct)
I have tried 2 different SQL Servers: SQL 2005 on production server and Sql Server 2008 R2 on local machine, I have tried windows authentication and SQL authentication. And it makes no difference.
But I can connect to both server (2005 and 2008) with MS SQL Server Management Studio with Windows and SQL server authentication. And it's not SQL Server permission issue - I have tried SA user to connect. It works with sqlservermanagementstudio, but not with LINQPad.
Any advice? Is there a setting on SQL Server I need to change?
Update 2: I found the solution to the problem.
Into Server field I had to put SERVERNAME\ without specifying SQLEXPRESS or MSSQLSERVER.
Not very intuitive =(
I found the solution to the problem.
Into Server field I had to put "SERVERNAME\" without any SQLEXPRESS or MSSQLSERVER.
Also as pointed out by #sgmoore, I could just type "LOCALHOST" or "SERVERNAME" and it connected.
Apparently this is SQL Server feature/bug, nothing to do with LINQPad.
UPD You can also use "." to denote "localhost"
You have to know the name of the computer you want and the name of the SQL-Server instance. For example, I have a computer named REB602, and, to use SQLEXPRESS on it (the SQL-Server instance that comes pre-installed with many versions of Visual Studio), then the string I type in is either REB602\SQLEXPRESS or .\SQLEXPRESS. The format is basically <computer-name> \ <instance-name>
I think the default instance-name for the full SQL-Server product is MSSQLSERVER, so if you don't know the name of the instance on the target computer, you can try that.
NOTE: it can take several tries to get a connection, because of the timeouts. I don't know if LinqPad lets you change the timeout -- I didn't see a way. When testing out my answer for you on computer REB602 this morning, I did "Test Connection" at the bottom of the LinqPad dialog box, got success, but the connection still timed out. I had to bring up SSMS (SQL-Server Management Studio, the IDE for SQL Server) to "warm up" my instance of SQLEXPRESS. After that, LinqPad worked like a dream. Don't give up on the first try :)

SQL Server 2005 Express - could not open a connection

I installed Microsoft SQL Server 2005 Express edition on my Vista Ultimate computer. However, when it opens I enter my computer name / SQLEXPRESS. When I click the Connect button, it gives me an error message.
Under the configuration tools I cannot find the SQL Server Surface Area Configuration. It only has SQL Server Error and Usage Reporting.
The error message I receive when I click the Connect button is:
A network related or instance specific error occurred while establsihing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that the SQL server is confugured to allow remote connection (provider: Named Pipes Provider, error 40- Could not open a connection to SQL Server) (Microsoft SQL Server : error 67)
From your question, as you'd written, it appears the slash is incorrect. Try:
.\SQLEXPRESS
Also ensure that your SQL Server services are started. Run services.msc and find SQL Server(SQLExpress).
Another thing to check for is the account that the SQL Express service is running under. I think it defaults to network service, but I typically run it under Local System (or if you're feeling ambitious, make a service account for it). This has taken care of a handful of permission issues I've had with SQL Express in the past.