July 18, 2008 at 9:06 am
I have two servers (A & B). I restore the database (DB1) from server A to Server B every night. Server A has login account called rpt1 with read only access to DB1. After restore is done on B, I want change the permissions of rpt1 to read, write, create & drop temp tables and execute SP.
Does anybody have the alter login/user script and willing to share?
Thanks,
KP
July 21, 2008 at 5:15 am
You can provide the user db_datawriter role to have the write privilege on user tables, for sp execution im not sure whether this works.
Exec dbname.dbo.sp_addrolemember @rolename ='db_datawriter',
@membername ='Username'
You can also add the user to dbo role in the db, but the user have all the rights in the db.
Exec dbname.dbo.sp_addrolemember @rolename ='db_owner',
@membername ='Username'
Regards..Vidhya Sagar
SQL-Articles
July 21, 2008 at 8:30 am
No it didn't work... I think I have not asked it correctly.
I have sql login (under security) account created. Now I need to add it as user to database DB1 as 'db_owner' using the script...
Any idea?
July 21, 2008 at 9:03 am
Try to make use of sp_adduser stored procedure.
Manu Jaidka
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply