DF034: A variable-size datatype of very small length is used.

The topic describes the DF034 T-SQL code analysis rule.

Category

BEST PRACTICE

Message

A variable-size datatype of very small length is used.

Description

It is not recommended to use variable-length data types with sizes less than 3 symbols.

Additional information

Using such small sizes may lead to inefficiencies in storage and processing, as variable-length data types are optimized for larger data sizes. Additionally, using very small sizes may not provide enough flexibility for storing meaningful data and could potentially lead to truncation or data loss if the data exceeds the specified size.

Noncompliant code example

DECLARE @v VARCHAR(1)

Compliant solution

DECLARE @v VARCHAR(30)

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?