TSQL - To CHAR or not to CHAR
Don't use VARCHAR for columns that only need 1 or 2 elements
i.e.
DON'T:
DO:
i.e.
DON'T:
CREATE TABLE [dbo].[Person] (
...
[Gender] VARCHAR(1) NOT NULL,
...
)
DO:
CREATE TABLE [dbo].[Person] (There is a Code Analysis option in DataDude that checks for this (SR0009).
...
[Gender] CHAR(1) NOT NULL,
...
)
Comments