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 2000 Forums
 SQL Server Development (2000)
 Query Multiple Databases

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2003-02-15 : 07:09:36
I have multiple courses, multiple databases.

It would reduce course maintenance if a single copy of the ASP web code could be deployed to manage all the courses. Each database stores administrator username / password pairs that are unique to that database / course.

I am gathering ideas on how a single login page could query all the databases for a match on the username / password and select the first database where a match is found. Once a match is found, the ASP code for the matching course / database can maintain context through session / state variables.

I'd appreciate any suggestions on a simple way to query all the admin tables.

Sam



Edited by - SamC on 02/15/2003 07:10:26

nr
SQLTeam MVY

12543 Posts

Posted - 2003-02-15 : 15:46:06
Can you have a security database which holds all the username / password pairs and database/course.
The app goes to that first to log in and find out which database to connect to.

==========================================
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

SamC
White Water Yakist

3467 Posts

Posted - 2003-02-16 : 00:31:22

I can't get away from needing a login database. I'm thinking it'll be easiest to write a stored proc that'll just query the 'N' databases for login 1 at a time till I get a hit.

Sam

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-02-16 : 03:05:42
Well you could create a view to union all the databases and include the database name and do a slect top 1 from that.

==========================================
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

SamC
White Water Yakist

3467 Posts

Posted - 2003-02-16 : 09:31:34
I'll need to allocate 1 username that can access all the databases for this purpose. I suppose role public is the weakest username.

I'll give this a try. It doesn't sound too bad.

Sam

Go to Top of Page
   

- Advertisement -