I got a multi-use SQL table in my SQL Server 2008 database. It can store only 100 characters as value.
Now I want to store a value in it that has more than 100 characters. Is it possible to zip or compress a text with SQL Server functionality?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your column is defined as
VARCHAR(100), it can hold a maximum of 100 characters. There’s no “magic” or “compression” that makes this go away.Yes, SQL Server has text compression – to reduce the disk space used. But if the column is limited to 100 characters, it can store no more than 100 characters.
If you need more – you need to define a column with a larger capacity. There’s no other solution.
It’s very easy to change a column’s datatype, too – so if you need to, you should be able to just issue a SQL statement like:
and now your column can store up to 150 characters. This is a non-destructive change, e.g. existing data will not be affected (not wiped out or deleted).