Home Forums SQL Server 2012 SQL Server 2012 - T-SQL If I understand Views VS Functions correctly...I should use views to enapsulated commonly used where clauses? RE: If I understand Views VS Functions correctly...I should use views to enapsulated commonly used where clauses?

  • Joining to a lookup table is the way we've got around a similar issue, ever changing values from users. And for the example of midwest states, we have a table of all states, just have a column in the table to house the value 'midwest' then reference that in the join.

    Then as you add or remove states from the group 'midwest' you don't need to change your code.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.