August 18, 2016 at 8:23 pm
Can you tell us a little about your database? Is it something you are in the process of constructing or is it something you have inherited? What is the purpose? What types of data are you storing? There may be a business case for having all columns VARCHAR(MAX) but it's very unlikely.
I'm just constructing it, and I have already taken into consideration the suggestions of the two gents who earlier replied to this thread, I'm just confused on why do we need to use VARCHAR(50) instead of VARCHAR(MAX) and their replies satisfied me. Well, any more ideas is greatly appreciated!
August 19, 2016 at 8:25 am
joshua 15769 (8/18/2016)
Can you tell us a little about your database? Is it something you are in the process of constructing or is it something you have inherited? What is the purpose? What types of data are you storing? There may be a business case for having all columns VARCHAR(MAX) but it's very unlikely.
I'm just constructing it, and I have already taken into consideration the suggestions of the two gents who earlier replied to this thread, I'm just confused on why do we need to use VARCHAR(50) instead of VARCHAR(MAX) and their replies satisfied me. Well, any more ideas is greatly appreciated!
Remember to use the adequate date/time data types instead of using strings or integers. Also, use numeric data types when appropriate (FYI, telephones and zip codes are not numeric data). Avoid storing formatted strings. Those are some of the most common mistakes I see.
August 19, 2016 at 8:34 am
Also, use numeric data types when appropriate (FYI, telephones and zip codes are not numeric data).
Social Security numbers are also not numeric. Once had a discussion with a programmer who told me that if they could be integers that they'd perform better. The discussion ended when I pointed out that many SSNs begin with one or more zeros.
August 22, 2016 at 8:26 am
RonKyle (8/19/2016)
Also, use numeric data types when appropriate (FYI, telephones and zip codes are not numeric data).
Social Security numbers are also not numeric. Once had a discussion with a programmer who told me that if they could be integers that they'd perform better. The discussion ended when I pointed out that many SSNs begin with one or more zeros.
The next part of the discussion should have been around the encryption of SSNs. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
August 22, 2016 at 8:31 am
The next part of the discussion should have been around the encryption of SSNs.
We were designing for a SQL 7 database (this was in the late 90s) and I was also primarily a programmer at that time. It might not have even been possible given the version, but if it was I was too new and too much an accidental DBA at the time to know better.
August 22, 2016 at 8:49 am
Jeff Moden (8/22/2016)
RonKyle (8/19/2016)
Also, use numeric data types when appropriate (FYI, telephones and zip codes are not numeric data).
Social Security numbers are also not numeric. Once had a discussion with a programmer who told me that if they could be integers that they'd perform better. The discussion ended when I pointed out that many SSNs begin with one or more zeros.
The next part of the discussion should have been around the encryption of SSNs. 😉
That's the reason of why I didn't include them in the examples. 🙂
August 22, 2016 at 8:57 am
That's the reason of why I didn't include them in the examples
I see your point now. You're right.
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply