Maintain Strict Domain Integrity

I'm curious to see if anyone can suggest a good way to maintain good domain integrity on sql server that will stop or warn user's if they try to join incompatible fields with the same data types.
For example
Select ORDER_ID, CUSTOMER_ID
FROM ORDERS o
INNER JOIN CUSTOMERS c
ON o.ORDER_ID = c.Customer_ID

This query clearly doesn't make sense as orders are not customers but SQL server will allow it if the data types are the same. Hence is there a good way to warn or prevent users from doing such queries?
geoffcolesAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
no way to block such incorrect "joins" from sql server.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
of course, good training will help to avoid :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.