Re: Data types
From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 10/14/04
- Next message: John Bell: "RE: System.Data.SqlClient.SqlException: Timeout expired"
- Previous message: JSmith: "Re: select and if together ?"
- In reply to: Ann: "Data types"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 13:43:45 -0500
To echo Tibor's comments. If the data is variably sized, use varchar. If
all values are equally sized, use char. Ignore nulls unless you have large
fixed length values and most of them will be null and you have disk space
concerns. Programming with fixed length char value is a pain.
-- ---------------------------------------------------------------------------- Louis Davidson - drsql@hotmail.com SQL Server MVP Compass Technology Management - www.compass.net Pro SQL Server 2000 Database Design - http://www.apress.com/book/bookDisplay.html?bID=266 Note: Please reply to the newsgroups only unless you are interested in consulting services. All other replies may be ignored :) "Ann" <anonymous@discussions.microsoft.com> wrote in message news:0b9301c4b210$2cd36990$a401280a@phx.gbl... > Have a database that I'm not sure how to determine which > to use... varchar or char. I've read up on it and am > getting conflicting views. What if I have a lot of fields > that are 8 characters or less? I thought I should use > char, but then I've read that you shouldn't if those > fields can be null. These fields can be null so should I > use varchar then? How do I determine which to use? Thanks!
- Next message: John Bell: "RE: System.Data.SqlClient.SqlException: Timeout expired"
- Previous message: JSmith: "Re: select and if together ?"
- In reply to: Ann: "Data types"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|