Skip to content

Comparison of the VARCHAR(max) and VARCHAR(n) SQL Server Data Types

'Problem

You are developing a SQL Server application and at some point in your code you receive the error "String or binary data would be truncated". After digging into the code you discovered that this error message is caused because a table has a VARCHAR(1000) column and you need to insert more than 1000 characters. Someone on your team suggest using the VARCHAR(max) data type, but you are unsure about the implications of the this data type.  Read this tip to learn what you should know about the SQL Server VARCHAR(Max) vs. VARCHAR(n) data types.

Solution

In order to decide between using VARCHAR(Max) or VARCHAR(n) we have to understand that even when both data types look the same, they have some major differences pertaining to storage, behavior and of course their intended usage.'...

https://www.mssqltips.com/sqlservertip/4485/comparison-of-the-varcharmax-and-varcharn-sql-server-data-types/

Trackbacks

Keine Trackbacks

Kommentare

Ansicht der Kommentare: Linear | Verschachtelt

Noch keine Kommentare

Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.

Kommentar schreiben

Standard-Text Smilies wie :-) und ;-) werden zu Bildern konvertiert.

Um maschinelle und automatische Übertragung von Spamkommentaren zu verhindern, bitte die Zeichenfolge im dargestellten Bild in der Eingabemaske eintragen. Nur wenn die Zeichenfolge richtig eingegeben wurde, kann der Kommentar angenommen werden. Bitte beachten Sie, dass Ihr Browser Cookies unterstützen muss, um dieses Verfahren anzuwenden.
CAPTCHA

Formular-Optionen