Hi all,
I have a recruitment site which is part of a large portal which has other services, so the whole portal has its own database apart from the recruitment's. and there's a couple of other databases. Now I want to authenticate the user once I mean if this user(JobSeeker) had already been logged in from somewhere on the portal modules, I don't want to ask him again to sign in to search jobs or modify his resume. Now, with that said I was wondering can I create a FK say UserID in the resumes table in the (Recruitment) database whose value is the PK of the Users table of the (portal) database. So, is that possible? I mean referencing a PK from a table in another database? If not, what is the best approach to integrate multiple databases within that portal and to implement the above functionality.
Another question is can I do a cross-database joins? and how?
Thanks
OK, two things:
-Cross-Database joins can done using the three part name Select * From Database.Owner.Objectname. If you enabled crossdatabase ownership chain you won′t have any problem if the query is embedded in a view. If the query is not embedded in a view, or the ownership chains breaks or you disabled cross database ownership chain, you will have to grant the user who tries to access the table in the other database the appropiate rights.
-Referential entegrity across databases can only be ensured using triggers.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment