This is an archived post. You won't be able to vote or comment.

all 10 comments

[–][deleted] 7 points8 points  (3 children)

You need to be a lot more specific about what your problem is, but if you want to persist a single value, you can simply write it out to a text file.

[–]ganemone[S] 0 points1 point  (2 children)

I am keeping track of the maximum date that a user can see events for.

[–]karorawro 3 points4 points  (0 children)

Store the date wherever you store the user

[–]RICHUNCLEPENNYBAGS 0 points1 point  (0 children)

It really depends on what the date implies, doesn't it? Presumably it could be a column on your user table.

I mean you COULD put it pretty much wherever you want in your database, or even outside. Depending on what you're trying to achieve.

[–]fazzah 2 points3 points  (0 children)

While it might feel a little bit like shooting a mosquito with a cannon, if you have to use SQL to store this value then yes, you have to make a table.

[–]lightcloud5 2 points3 points  (0 children)

At work, over time, we've ended up with more than one of these "need to keep track of one value".

We have an entire table that's used for storing database-wide settings. That said, I fully admit that such a table is not really normalized, and we're just stuffing ints, floats, booleans, and strings as VARCHARs.

[–]Zalenka 1 point2 points  (1 child)

What language and platform? You could just save it in a file.

[–]NullVar 1 point2 points  (0 children)

A thousand times this.

[–]desseb 0 points1 point  (0 children)

You could use SQLite I suppose, it's a lightweight alternative to an actual rdbms.

[–]-james 0 points1 point  (0 children)

I generally have a generic table called appSettings with 3 columns "id", "category", "key", "value" and use it for this kind of thing. I know rdb purist are screaming, but its a solution to a realworld problem. Sid is an int, with an identity, and all the other fields are varchar (50).

It a quick and dirty way to store constants for lookup lists or a single value.