Home > Ask the SQL Server Experts > More SQL Server Expert Responses Questions & Answers > Converting varchar columns to text data type
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Converting varchar columns to text data type

Jorge Cano EXPERT RESPONSE FROM: Jorge Cano

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 11 April 2004

One of the developers in the shop in which I work received an error stating that "string or binary data would be truncated" when he attempted to enter data that had more characters than the receiving varchar column could contain. He is now asking that all varchar columns that are greater than a certain size be converted to the text data type. Are there any reasons why this should not be done?


>

As a matter of fact, there are only a few things to consider. Obviously the storage size that you can reach will be much greater (2GB Vs. 8000 bytes) but then, you CAN'T apply or make some things in that kind of field. For example, to use an INDEX in that field, use it in a WHERE clause. If the text storage is greater than 8000 bytes (if it is a character or binary string), you'll not be able to reference the value in a SELECT, UPDATE or INSERT statement and will be forced to use special functions in SQL to manage the contents of that field.

It also depends on the objective of that field and the future management of it, so you can decide if it does not affect the rest of the database structure.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
More SQL Server Expert Responses
Applying LDF file to MDF without turning it to .BAK first?
Any way to alias a call to functions?
"Max connections reached" error
Application freezes for 30 seconds on VPN
Adding column and changing datatype
Adding new column to table that is part of replication
Any issues with linking 7.0 and 2000 databases?
'Format' in SQL Server
Accessing SQL Server databases on an intranet with VB.NET
Building nested tables in SQL Server?

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts