SQL Server SA Password for SQL Server Authentication? - sql-server-2008

I am working on SQL Server 2008 and currently I am using my local server with windows authentication. Can i set SA password for SQL Server Authentication? What are the steps and also I want to know what is the difference between Windows and SQL Server Authentication?

Window Authentication: If you are authorized user to window and you have proper right to access sql server. you are all done to access sql server, you don't need any username/password to access sql server.
SQL Server Authentication: You need to create new user to access sql server (a part from window user). You need username & password of newly created user to access sql server.
You can create new SQL Server Authentication user by: Object Explorer >> Security >> Login >> New Login. Again, you need required right for the window user through which currently you are accessing sql server.

Related

SQL Server 2008: New Domain user rights issue

I have a SQL Server 2008 installed on Windows Server.
The problem I am facing is when I create a new user in windows, and then add that user in SQL Server Logins [Domain\Username] with Windows authentication, and give access to one database [inventory].
When the user logs in into SSMS, and when s/he expands the object explorer, he get an error message:
The server principal "Domain\User" is not able to access the database "Payments" under the current security context.
(Microsoft SQL Server, Error: 916)
If I give access to the Payments database, the user is able to see the database list in the object browser.
I do not want to give access to the Payments database.
Please help.
Mansoor

Connection to SQL Server 2008: error 18452

I have a problem with connection to SQL Server 2008.
My problem is all simple user can't connect to SQL Server 2008 but just the admin in subdomain only who can connected.
I test the connection with these steps:
control panel / set up odbc
system DNS / I choose SQL Server
click on the bottom Add
in the Name=test, and the server = I choose SQLSERVER
When I clicked Next bottom I have error 18452.
Connection failed: SQLState: '28000'
SQL Server Error: 18452
[Microsoft][ODBC SQL Server Driver][SQL Server] connection failed.
SQL Server Error: 18452
Login failed for user ". The user is not associated with a trusted SQL
Server connection.
You should create new DSN with changed Authentication Mode from Windows Authentication Mode to SQL Server Authentication. Then specify login and pass for connection. This login should be added on SQL too.
I were trying to do the same, saw a lot of videos trying to accomplish the add of the DSN but this was my solution.
I'm running Windows Server 2016:
I ran the ODBC 64bit -> System DSN tab -> Add button
Then I selected SQL Server, since i had SQL Server Management Studio 17.
I putted a Name and the fact that is really important: Write the SQL Server you know you have connection to on the Server field.
Be sure you had configured the Security on Server authentication for SQL Server and Windows Authentication mode and then write the user you know that have access to that Data Base.
Last step: you click next after putting the info of the user that have acces to the SQL Server and the connection will pass.
Hope this help someone.

SSRS cannot login to SQL Server database

I deployed my report to the report server. This report has some DB connection which uses Windows Authentication.
When I run the report from the same server works fine, but when I try this from a remote sever I errors saying EXECUTE permission denied on the stored procedure.
The EXECUTE permission was denied on the object 'sp_xxx', database
'DB', schema 'dbo'.
I did further analysis and found that when the report try to connect to the DB is uses NT AUTHORITY\ANONYMOUS LOGON login.
And the report server is running under NT Authority\NetworkServices.
p.s: Also the remote server and the report server is in the same domain.
What am I doing wrong which is not passing my Windows authentication?
Please help...
If you have access to the server you should define a ReportUser user that has access to ssrs and mssql since you are using windows auth. When you deploy, the dataset credentials should be set to the same user above. This would be akin to going into ssrs and setting the configuration of the dataset of the report to a known user account with sufficient privileges to run the report and query the database.
I'll try to walk you through, I hope I haven't forgot something
Can you connect to your server remotely using management studio and your admin credentials? (Check TCP/IP is enabled under SQL Server configuration manager)
Have you assigned enough permissions to the security role? have you assigned the user to the role?(check this out - Grant execute permission for a user on all stored procedures in database?)
Can you successfully connect with your data source? (Check username and password are working)

connecting to sql server from classic asp

I have a sql server 2008R2 express running in windows authentication mode. I created a login and a user for a database in sql server based on a windows account. I can connect to sql server database via(run as the user) SSMS and browse my database just fine.
Now i am trying to connect via a 3rd party asp application
set loginDB = Server.CreateObject("ADODB.Connection")
'For Windows Server 2008 / SQL 2008 users, please use the following line for the DB connection
loginDB.Open "Provider=SQLNCLI10; Server=(local)\SQLServerName; Database=dbname;Uid="myuser" Pwd="pwd""
I am getting an error saying login failed for user myuser
Also the site is running on an app pool which i have set it to run as the windows user myuser.
Where am i going wrong???
Thanks.
If you are passing username and password that's SQL Server Authentication not windows, so if it's authentication mode is Windows only, it won't have it.
Take them out and replace with Integrated Security = SSPI

Cannot create sql server database user correctly

I'm trying to create a user in a SQL Server database with SQL authentication. That's what I did:
Created database named testDb (with default parameters)
ran script
CREATE LOGIN test
WITH PASSWORD = 'test';
USE testDb;
CREATE USER test FOR LOGIN test;
GO
Ensured user test appeared in Databases\testDb\Security (in Management Studio)
Tried to connect to the server with Management Studio using user test
Got 18456 error.
I'm using SQL Server 2008 Developer Edition. The OS is Windows 7 Ultimate. What am I doing wrong?
By default SQL Server logins are disabled.
You need to right click the instance in SSMS object Explorer then from the "Properties" dialogue, Security Tab enable "SQL Server and Windows Authentication mode".
This requires a restart of the SQL Server service to take effect,