Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server User Permission


SQL Server User Permission

Author
Message
D.K.Mishra
D.K.Mishra
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 130
I have Two Servers
1. Production
2. Development

I have prepared a database backup on production server and restore it on development server.

I want to give permission to a existing user on production server for new database.

Whats process i have to follow....

Please tell me step by step because i am new on sql server.


Regards
Dharmendra Kumar
09717765141Hehe
Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)

Group: General Forum Members
Points: 937 Visits: 866
Your question is not clear. You say that you want to give permission to new user in the prodcution database. But in that case, why do you mention the fact that you copied it to the development server?

Also, are talking about an SQL login or a Windows login?

And what permissions do you want to assign? To permit a user to access a database at all, you do:

USE master
go
CREATE LOGIN [domain\someuser] FROM WINDOWS
go
USE mydb
go
CREATE USER [domain\someuser]


The user will now be able to access the database, but unless you have granted access to public (and you shouldn't), he will not be able to see or modify any data in the database.

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
D.K.Mishra
D.K.Mishra
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 130
I restore backup database on development server, and i want to give permission for new restored database to a existing user on development server.
Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)

Group: General Forum Members
Points: 937 Visits: 866
Dharmendra JKT (9/20/2013)
I restore backup database on development server, and i want to give permission for new restored database to a existing user on development server.


OK. But what permission? Should the user be able to do anything in the database? Only read data? Only access certain tables? Be able to create stored procedures, but not tables?

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
D.K.Mishra
D.K.Mishra
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 130
Hi,

Want to give read and write permission of new restored database.

Regards
Dharmendra
Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)SSC Eights! (937 reputation)

Group: General Forum Members
Points: 937 Visits: 866
Read and write data, but not being able to alter any objects? In that case do

ALTER ROLE db_datareader ADD MEMBER [domain\user]
ALTER ROLE db_datawriter ADD MEMBER [domain\user]


or, if you are on SQL 2008 or earlier:

EXEC sp_addrolemember db_datareader, 'domain\user'
EXEC sp_addrolemember db_writereader, 'domain\user'



You first need to add the user to the database as per the previous post.

As I typed these commands from memory, I advice you to check the exact syntax in Books Online.

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search