regarding foreignkey data
-
I have two tables. both tables have a common column (named=Rank) I have made table1 column(Rank) as primary key I have made table2 column(Rank) as foreign key every thing is working properly problem is when i enter some invalid data in table2(into Rank) which is not there in table1 I want to generate a pop up is this possible thanks in advance
-
I have two tables. both tables have a common column (named=Rank) I have made table1 column(Rank) as primary key I have made table2 column(Rank) as foreign key every thing is working properly problem is when i enter some invalid data in table2(into Rank) which is not there in table1 I want to generate a pop up is this possible thanks in advance
U can enter only enter those values in table2(Rank) which are present in Primary Key. This is the fundamental of having a foreign key. If you want to add values other than those in primary key remove the constraint.
-
U can enter only enter those values in table2(Rank) which are present in Primary Key. This is the fundamental of having a foreign key. If you want to add values other than those in primary key remove the constraint.
-
thats wat i am saying when i enter other values i want to generate an popup message showing error
If itz in a form, u can trap the error number and popup a window with the message. Use "Try Catch" and popup window in Catch
-
thats wat i am saying when i enter other values i want to generate an popup message showing error
-
kiranreddy wrote:
i want to generate an popup message showing error
You need to do that in your application, there is no such thing in sql.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP