How do I add the Foreign Key Sort order in the following statement:
ALTER TABLE [dbo].[ActionLog]
WITH CHECK ADD CONSTRAINT [FK_ActionLog_Order] FOREIGN KEY([OrderID])
I want the OrderID to be descending.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A foreign key constraint only ensures the values already exist in the table referenced, not order. For referential integrity, the database doesn’t care what order of the data is.
The only way to ensure order in a resultset is to use an ORDER BY clause.