0

I am using a desktop based windows form application ..need to save a huge text field in sql sever db .Which one is better

  1. varbinary(max)

  2. varchar(max)

  3. Blob

  4. Any other

Can anyone please explain the pros and cons .!

As it will be run in users desktop don't want to make an overhead (making the application slow/Crash their application)

Rahul Chowdhury
  • 1,138
  • 6
  • 29
  • 52
  • Are you going to search for individual pieces of data within the large field. Will this information need to use differing alphabets from different countries? Are you going to need to edit the conternts of the filed once entered? Define huge. What version of SQl Server? – HLGEM May 21 '14 at 19:17
  • Comparison of data types are available at http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-vs-blob-text – jdiver May 21 '14 at 19:18

1 Answers1

1

Since you will store "huge text", assumed to be greater than 64kb, you should use MEDIUMTEXT or LONGTEXT.

MEDIUMTEXT – up to 16MB
LONGTEXT – up to 4GB

The actual problem will be data storage in terms of performance. TEXT and BLOB is stored off the table with the table just having a pointer to the location of the actual storage; depending on your hardware especially disk/io performance this may create a bottleneck.

varbinary and blob is for binary data.

jdiver
  • 2,228
  • 1
  • 19
  • 20