0

Please see the T-SQL below:

create database db;
go
use [db]
create login [standard] with password ='dkdkdkqajHGgbh56'
CREATE USER [standard] FROM LOGIN [standard];
exec sp_addrolemember 'db_owner', 'standard'

After running this I try to login to SQL Server Management Studio as standard and I am prompted with this error:

login failed for user: standard

What am I doing wrong?

PS: I cannot even login as sa. I have enabled 'SQL Server Windows Authentication mode'. I am a developer (not a DBA) trying to setup a local instance of SQL Server.

asked Feb 25, 2016 at 14:18
2
  • 3
    Can you verify your authentication mode using SELECT CASE SERVERPROPERTY('IsIntegratedSecurityOnly') WHEN 1 THEN 'Windows Authentication' WHEN 0 THEN 'Windows and SQL Server Authentication' END as [Authentication Mode] . SA is disabled by default so it's not expected to work out of the box. Commented Feb 25, 2016 at 15:03
  • When you use the Connect to Server box to connect, what is in the Authentication box? Is it "Windows Authentication" or "SQL Server Authentication"? Commented Feb 25, 2016 at 16:20

1 Answer 1

2

I had to enable: 'SQL Server and Windows Authentication Mode', then restart the SQL Server 2012 service.

answered Feb 25, 2016 at 16:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.