December 8, 2011 at 12:30 am
Comments posted to this topic are about the item Ensure Table has only one row
December 8, 2011 at 8:16 am
Sometimes I want to keep a "history" of the different settings, or have more than one set depending on circumstances. In these cases, I use a "current" column (bit) to determine which row I should be using. Just for info.
December 8, 2011 at 1:39 pm
An alternate method to insure only one row (or 2, 3, ... rows) would be to simply define a unique key and check constraint on the table's ID column.
create table tempdb..foo
(
foo_id int not null primary key check (foo_id = 1)
);
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
May 11, 2016 at 11:40 am
Stephen_W_Dodd (12/8/2011)
Sometimes I want to keep a "history" of the different settings, or have more than one set depending on circumstances. In these cases, I use a "current" column (bit) to determine which row I should be using. Just for info.
Thanks for the tip.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply