New answers tagged

3

Max Vernon's answer is correct in all but: No need for NULL in a bit value. It should be non-null, default 0. Querying a field which could be NULL adds overhead to your writing/reading/code maintenance. Basically the "correct" way to query a bit field is WHERE flag <> 0, if you might have NULL in the bit field you can still ask WHERE flag <> 0 (the ...


6

Having a flag on the Stations table that indicates which station is local would be exactly how I'd handle this, presuming you don't have a billion stations. I'd likely call the column IsSourceStation or something, and make it a BIT value, that can accept NULL. I would mark the local station row as 1, and leave all other rows as NULL, since that won't take ...



Top 50 recent answers are included