Connection issues when trying to connect to a SQL Server database - sql-server

I'm trying to connect to a remote SQL Server database. It's being hosted on another server within the network at my workplace, but I keep getting an error when trying to connect while being logged in under a specific Windows (AD) account.
I'm using SQL Server Management Studio from my local server. I tried logging in with account "x". When specifying the connection string I'm using a SQL Server authenticated user. This is when I get the error below:
I logged in with a different account "y" to the server and attempted the database connection again (with the same SQL Server authenticated user), and it worked.
Why would I be able to connect under one Windows account and not the other (from the same server) when I'm trying to connect with a SQL Server authenticated user?
Could this be that the Windows account is not part of the correct administrator group?
Any thoughts or insights are appreciated.
Thank you,

Related

Problems with connecting to SQL Server instance on multiinstance computer

I have a computer with several SQL Server instances installed - 2008, 2012 and 2016. From this computer there is no problem to connect to any of them using Windows Authentication.
Now I try to connect to the SQL Server 2016 instance from another computer. On the server computer I've created the appropriate Windows user and SQL Server login. But when I try to connect to this instance from the different computer, the login fails.
Finally I've managed to connect to SQL Server 2016 database engine using following server name:
TCP:ALEXMWIN81,49602
But when I try to connect to the SQL Server 2016 Analysis Services, the login again fails.
Can anybody give some advice on how to connect? All instances are very important and re-installation is a problem.
Thanks in advance. Alexander Mitchenko
When you say
On the server computer I've created the appropriate Windows user and SQL Server login.
This makes it sound like you are creating a local windows login on the server machine. It should be noted that in order to use Windows authentication both your connecting machine and the server need to be on the same domain.
Creating a SQL login is a separate authentication process called "SQL Server Authentication". When you use this methodology you connect with a username and password only. For this process you would connect by putting the login credentials into a connection string.
Do you have multiple domains? This can cause problems.
Cross Domain SQL Server Logins Using Windows Authentication
Does the SQL instance expose all the required ports to the internal network?
https://msdn.microsoft.com/en-us/library/cc646023.aspx
Is the server running a Windows Firewall?
What software are you connecting from?

Attempt to migrate SQL Server database to Azure fails with login failed

In SSMS, I'm trying to use the "Deploy Database to SQL Azure Database" utility.
I'm moving a small local database in SQL Server 2012 to Azure for hosting. But after entering the host database server connection parameters I always get a "Login Failed for user,...." error, referencing the name of the local database to be created on the server.
Why this would fail is unclear, since the database does not exist on the cloud server yet. Here is what I have done:
Set up a firewall exception for my local IP address.
Confirmed my server administrator user name and password
So now I am left guessing... Locally I use Windows Authentication. If a database is to be moved to the server, does it have to have SQL Server authentication, as is required on Azure host?
You need to have the SQL server Authentication enabled in order to be able to login to your database when you move it to Azure.
Once, you login through SQL server authentication, you can create your users then and have different logins for different users.
Hope this helps!

How can I use an Active Directory login in Microsoft Access linked to SQL Server?

We have a client who uses MS Access to manipulate data in their SQL Server DB. I know that we can set up SQL Server to authenticate using Active Directory. If we set this up, can they use their AD logins to connect to SQL Server through Access? How?
I tried Googling this, but to no avail. Any links or direction would be much appreciated. Thank you.
Also, please direct me to the correct place, if I should ask this question elsewhere.
Yes this should be pretty straight forward. You can use Windows Authentication to connect to sql server.
When establishing ODBC connection from your Client, The Wizard for connection configuration to SQL Server takes you to a page which gives you options to choose how you want to connect to SQL SERVER. There you can choose to use Windows Authentication or SQL Server Authentication. You can choose the Windows Authentication Option.
Now when a client tries to connect to the SQL Server their windows credentials will be used to authenticate the user. And obviously if they are on a network their AD Account will Authenticate them.
See below a snapshot from ODBC Data Source Administrator wizard when configuring connection to sql server.

Connecting to remote SQL Server

I have installed SQL Server 2005, the SQL Server instance name is SOSO, the machine name is HERO, I tried to connect from another computer using SQL Server Management Studio:
Server name: HERO\SOSO
Authentication: Windows Authentication
But I didn't succeed.
SQL Server is enabled to be connected remotely.
So what is the problem?
Windows Authentication uses the Active directory user from the connecting machine to authenticate with the database. Does it have the right permissions to access the database? Maybe try authenticating with a SQL Server database user first. Maybe you've created a SA user on installation, try connecting with that.
But as the other replies also tell, first check network / firewall connection and please provide us with the error message.

SQL Server Windows Authentication

I'm trying to connect to a remote SQL Server Express machine using Windows authentication.
I´m logged on with a user with username Administrator, but when logging in, I get the error message:
Login failed for user guest ...
Why is not using the Administrator account?
Thanks in advance.
For Windows Authentication to work, the target machine has to be on a domain where your Windows credentials will be recognized. If the server is outside of your organization's control, it will not recognize your credentials and you will have to use a Sql Server user ID and password to log in.
SQL Server Express by default only allows local connections - you can enable it, but you have to explicitly do so.
See these:
SQL Server Express team blog: how to enable Express to accept remote connections.
How to enable Remote Connection on SQL Server 2008 Express

Resources