Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Giving users access to restored vendor database

Status
Not open for further replies.

mkrausnick

Programmer
Apr 2, 2002
766
US
Each morning I download and restore a fresh copy of a vendor's SQL2000 database for reporting. Being the administrator, I can access this database with no other action required. However, other employees who need to run reports have no access to the database. If I manually add their group to the database and assign the datareader role to the group, then they can access the database.

How would I automate the adding of the group and setting of the privilege? I tried sp_addgroup but that didn't work.

Thanks!

Mike Krausnick
Dublin, California
 
Code:
sp_grantdbaccess 'YourGroupLoginName', 'NameToUse'
GO
sp_addrolemember  'db_datareader', 'NameToUse'
GO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top