Add a new column to the table, then add a validation constraint and a uniqueness constraint to this column. For instance:
CREATE TABLE logging ( LogId integer UNIQUE default(1), MyData text, OtherStuff numeric, Constraint CHK_Logging_singlerow CHECK (LogId = 1) );
Now you can have only one line with LogId = 1. If you try to add a new line, it will either violate uniqueness or check the restriction.
(Maybe I messed up the syntax, but does this give you an idea?)
source share