September 17, 2009 at 3:19 pm
I have been trying to figure out a good way to make a FK relationship from a view to a table. I know you can't add FK's to views but is there another way to make a relationship to another table?
A developer wants this FK relationship so Linq will recognize it.
My view looks like this:
SELECT Username, Password, UserTypeID, MemberID, CreatedDate, LastLogin, Deactivated
FROM dbo.Login
WHERE (UserTypeID IN (5, 6))
This view is just to show a certain type of users. I want to link the UserTypeID to the UserType table.
Any ideas? Thanks in advance.
September 17, 2009 at 4:45 pm
Quite frankly I just don't think you can do it..
CEWII
September 17, 2009 at 4:51 pm
Agreed. All RI constraints need to be built out on the base tables.
Also, if they are using the Linq to SQL portion where Linq is building out the SQL code....look out!
September 17, 2009 at 5:00 pm
Yeah, thats going to be messy isn't it..
CEWII
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply