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 2005 Forums
 SQL Server Administration (2005)
 Script for User Mapping

Author  Topic 

snehal_bhayani
Starting Member

2 Posts

Posted - 2007-09-24 : 06:56:01
Hi all,
I have to provide user mapping between two databases on the same server so that the tables and content of both the databases can be accessed by each other.
I know how to do it using Enterprise Manager, but I have to do it via script as in my asp.net application the databases are created dynamically.
If I am not wrong, then "sa" login will be required to execute this script, but no problems as we will be having the "sa" password also.
Can anybody please let me know how to do it exactly. Its very urgent.
Thanx a lot in advance.

Snehal Bhayani

nr
SQLTeam MVY

12543 Posts

Posted - 2007-09-24 : 10:02:26
Easiest to create a role in the databases, grant the permissions to that role then add the users to it in each database.
You are actually mapping the logins to users in the database with the correct permissions ratgher than mapping between databases.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

snehal_bhayani
Starting Member

2 Posts

Posted - 2007-09-25 : 01:19:19
Thanx a lot. But as I am very new with Sql Server 2005 Security portion, can you please provide me an example (script) as to how can this be done.
Thanx a lot for your patience.

Snehal Bhayani
Go to Top of Page
   

- Advertisement -