• actual foreign key constraints cannot expand to objects outside of the existing database.

    you could potentially create a user defined function that is used as a CHECK CONSTRAINT, which checks if the data matches the cross database criteria, but if the other database was no longer accessible(network errors,security issues, linked server credentials being invalid, double hop issues), or the data on the linked server changed due to a restore, the check constraint would only be preventing new rows from being added, and maybe raise an error during an update, both of which could prevent data from being saved.

    probably not what you want.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!