General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Excluding records inactive records from tables.
I have about 200 tables in a MS SQL Server database and each table has a field called 'Record_status'. When Record_Status is null the record is considered as an 'active record'. Whenever I send a SQL statement to the server, I add an additional condition with WHERE clause. Example:
Select a.*, b.*, c.* from tbl1 a, tbl2 b, tbl3 c where ......... and not isnull a.record_status and not isnull b.record_status and not isnull c.record_status....
Can somebody advise me how to build a rule at the server level so that SQL engine does not include inactive records from each table when a SQL statement is parsed? I am looking for a solution other than Views (SQL Views).
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only