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

(update Set) Blocked field = 1 when there is no sells to one client.

P: 1
have a table client.
code Int
blocked tinyint
name varchar

have a table sells.
data date
client Int
total float

I want update blocked field with 1 when there is no sells for the client.
Jan 29 '13 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,359
You should not store the blocked field as that breaks the rules of normalization. Instead you should calculate it as needed.
Jan 29 '13 #2

P: 185
Adding to Rabbit's statement, you have computed fields saved in the database if you want save some processing but you don't care about the size of your data. In some cases, you need to de-normalize for the sake of performance.
If you know that already and still want to keep the field in the DB, you may create a before insert trigger that does this for you.
Jan 29 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.