By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

Setting up a Settings Table

P: n/a
I am creating an image gallery system, where there is an admin and
multiple users upload images. Each user is restricted to uploading 8
images. Currently, I have this hard coded into a trigger. I would
like it to use a table field instead... one that the admin can change
on the fly. I want to call this table Settings, but I want to create
insert 1 record, and then block all subsequent INSERT statements
(there's only going to be 1 setting) so that the Settings table will
only have 1 record in it for its entire lifetime. What's the best way
to do this?

May 10 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I would create a table like this:

CREATE TABLE Settings (
DummyID tinyint DEFAULT (1) PRIMARY KEY CHECK (DummyID=1),
MaximumImages int NULL DEFAULT (8)
-- ... and other settings when needed
)

INSERT INTO Settings DEFAULT VALUES

Razvan

May 10 '06 #2

P: n/a
Thanks.

Razvan Socol wrote:
I would create a table like this:

CREATE TABLE Settings (
DummyID tinyint DEFAULT (1) PRIMARY KEY CHECK (DummyID=1),
MaximumImages int NULL DEFAULT (8)
-- ... and other settings when needed
)

INSERT INTO Settings DEFAULT VALUES

Razvan


May 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.