Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 How to add a user id and password to SQL Server Da

Author  Topic 

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-22 : 18:08:40
Hello

I make a copy of a database on my Local SQL Express server
The server use Windows Authentification

What I want to do is to set up a SQL server Authentification in order to use my application with the same User Id and Paswword as in production ( for compatibility purpose)

How can I do that ?
What are the steps ?
It seems a little bit obfuscate

Thanks for any help

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-22 : 20:47:18
If production is using Windows authentication, then you can't use SQL authentication without changing the connection string. You have to specify which one it is.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-23 : 01:53:57
Hello

Production is Using SQL Authentification
- I don't have any problem to buil or change the connexion string
- I can acceed my test base with a new connexion string as this

database=ZIStat;server=BARA01\\SQLEXPRESS;Trusted_Connection = True;


What I want to do is to add User ID and PWD to ma Test base to be able to run my application without having to change the connexion string

database=ZIStat;server=BARA01\\SQLEXPRESS;User ID=olibara;pwd=olibara;

So the question is HOW can I do that
What are the steps ?


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-23 : 11:11:09
Then you just need to add the login to the SQL Server via Management Studio. Find the logins section in there and add it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-23 : 15:32:07
quote:
Then you just need to add the login to the SQL Server via Management Studio. Find the logins section in there and add it.


Thank you
But it is certainly not so simple. I've spended all my sunday to find such "easy" way

This it the reason why I'm trying to refers to gurus to find the roadbook steps to set up such login properly

I'm still on it right now !
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-23 : 15:44:38
Hello

I think that I'm a step plus loin
Now I can open a connexion on the database using Sql authentication connexion string

But I get the message

quote:
"The SELECT permission was denied on the object 'Alias', Database 'ZIStat', schema 'dbo'."}


So what else is missing
Sorry to be so stupid but I'm a developper, not a DB Admin and the topic about settings User Id an Login to Sql Server is really obfuscate !!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-23 : 17:12:19
How did you make the copy of the database? Did you use BACKUP/RESTORE?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-24 : 01:42:43
quote:
How did you make the copy of the database? Did you use BACKUP/RESTORE?

Yes but this is no matter, because I also wants to set the same rights to a newly created database
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-24 : 03:39:36
Yes it does matter as the permissions come across with BACKUP/RESTORE.

For a new database, then script everything out from the source and run that script on the destination.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2010-08-24 : 14:26:23
Finaly hera are the steps

1- In SQL server Management studio, right click on Main server Node
2- Select Security Node
3- Set Radio Button SQL Server And Windows Authentication mode
4- Reboot
5- Create a new Login / Pasword

USE master;
CREATE LOGIN olibara WITH PASSWORD = 'olibara01';

Bt default SQL server requires a enhforced password, it can be changed later

6- Add DU Users

USE ZIStat;
CREATE USER olibara FOR LOGIN olibara;
USE Touch;
CREATE USER olibara FOR LOGIN olibara;

7- If necessary release pasword Enforcement :
- Open MNG Studio
- Select node Security / Login
- Right-Click on Login property to change
- UnCheck option Enforce Pasword Policy
- Change password

Then you can open the database with SQL Authentication connexion string but you will get the message on any select

{"The SELECT permission was denied on the object 'Alias', database 'ZIStat', schema 'dbo'."}


1- Open MNG Studio
2- Select la database
3- Extend sécurity node of database
4- Extend User Node
5- User Property
6- In the Chechedlistbox "Role Member" (I still don't know the purpose of the other)
7- Check DB_Owner, DB_SecurityAdmin ( It seems to be enough )

Go to Top of Page
   

- Advertisement -