Questions tagged [varcharmax]

The maximum count of type varchar

The maximum count of type varchar. A varchar or Variable Character Field is a set of character data of indeterminate length. The term varchar refers to a data of a field (or column) in a database management system. Varchar fields can be of any size up to a limit, which varies by databases: an Oracle 9i database has a limit of 4000 bytes, a MySQL database has a limit of 65,535 bytes (for the entire row) and Microsoft SQL Server 2005 has a limit of 8000 bytes (unless varchar(max) is used, which has a maximum storage capacity of 2 gigabytes).

71 questions
0
votes
1 answer

"String or binary data would be truncated." for NVARCHAR but not VARCHAR in LIKE operation

In SQL Server, nvarchar takes twice the space of varchar, and its pre-page-pointer limit is 4000 compared to varchar's 8000. So, why does the following like comparison give a String or binary data would be truncated. error... select 1 where '' like…
Devin Burke
  • 13,642
  • 12
  • 55
  • 82
0
votes
1 answer

Ms Access and SQL Server nvarchar(max) limited to 4000 characters

I have an Access 2010 application which has a table linked to SQL Server 2014. I have a table Messages which has a couple of columns, one of which is of type nvarchar(max). When trying to save a text with a length over 4000 characters to that…
0
votes
4 answers

How to select a variable length string from between two known strings in SQL Server in a VARCHAR(MAX) where some columns don't have applicable strings

Using SQL Server 2012, I need to get from this example ColumnName -------------------------------- Enroll to: Carol Goals are many and varied characters that don't include desired results Enroll to: Jan Levinson Goals will be discussed at…
0
votes
1 answer

Can't delete a row from database with empty value on text-type column

While trying to remove a row from my database in SQL Squirrel I get the following error. Now, this happens when the text-type column has value '' (as in empty) When it has null, there's no error when deleting. Why is this? Would it help if I…
Steve Waters
  • 3,348
  • 9
  • 54
  • 94
0
votes
0 answers

SQL Server semantic search: varchar(max) vs filetable

According to your experience, what's the best option for performing semantic searches for html, word and pdf files? Should the files be saved in a varchar(max) column or directly on disk (in a FileTable)? File sizes aren't restricted to a maximum…
Luis Abreu
  • 4,008
  • 9
  • 34
  • 63
0
votes
1 answer

Reorganize table after converting from TEXT to VARCHAR(MAX)

I have a large table with a TEXT column. I ALTERed the column to VARCHAR(MAX) using the following statement: ALTER TABLE MyTable ALTER COLUMN Details VARCHAR(MAX) I read that the difference between TEXT and the new equivalent VARCHAR(MAX) is that…
nvm-uli
  • 626
  • 1
  • 7
  • 14
0
votes
0 answers

After changing a column from ntext to varchar(max) a query becomes slightly slower

After changing a column from ntext to varchar(max) a query becomes slightly slower. I'm doing a select * from table_with_ntext vs select * from table_with_nvarchar_max I thought that since the lob logical reads decrease so much (213860 vs 6) vs…
roncansan
  • 2,310
  • 6
  • 27
  • 34
0
votes
2 answers

Search within all text in varchar(max) column

As a result of Googling, it turns out that both LIKE operator and CHARINDEX() function search only first 8K of varchar(max) column. Is this a correct statement? If so, how to search for a substring in full text of varchar(max) column without…
Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
0
votes
0 answers

Convert Mysql varchar(8192) to MSSQL datatype

I am migrating a MYSQL db to MSSQL. I have a MYSQL column with datatype varchar(8192). MSSQL varchar(8000) seems like the best in terms of performance but there could be data that's between 8000 and 8192. I am curious as to what the most performance…
kwm
  • 29
  • 4
0
votes
3 answers

SQL Server varchar(MAX) parameter results in "Parameter object is improperly defined"

I have a field in a table that I want to store a potentially long error string. To this end I selected varchar(MAX) as the data type. I have created a stored procedure that is used to enter that data in the table and for the field "ErrorDescription"…
webworm
  • 10,587
  • 33
  • 120
  • 217
0
votes
4 answers

Is it possible to have a nvarchar(max) and a varbinar(max) fields in same table

I am using SQL Server 2008 R2. I have a table which has several fields including a nvarchar(max) field. When I try and add a new field of type varbinary(max) I get an error message: "Saving changes is not permitted. The change that you have made…
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
0
votes
1 answer

Data type 0x23 is a deprecated large object, or LOB, but is marked as output parameter

I'm trying to receive a varchar(max) output param from an stored procedure but I'm getting the error above , i.e Data type 0x23 is a deprecated large object, or LOB, but is marked as output parameter when I execute the SP in vb.net I have tried…
j-j
  • 93
  • 1
  • 13
0
votes
2 answers

Smart CONVERT float to VARCHAR in T-SQL

I have the following code DECLARE @m FLOAT=213456789.55 DECLARE @sql VARCHAR(MAX)='INSERT INTO Test VALUES('+CONVERT(VARCHAR,@m,1)+')' EXEC(@sql) but the result is 213456790 instead of 213456789.55 When I try to write…
Bellash
  • 7,560
  • 6
  • 53
  • 86
0
votes
2 answers

varchar(max): how to control the length of "in row" data

I keep reading stuff like this: The text in row option will be removed in a future version of SQL Server. Avoid using this option in new development work, and plan to modify applications that currently use text in row. We recommend that you…
johnnycrash
  • 5,184
  • 5
  • 34
  • 58
0
votes
0 answers

RTRIM not working as expected

I am facing a strange issue where RTRIM which I have used thousands of times is not working as expected. It's almost like there are characters at the end that look like spaces but SQL 2008 is not treating them like spaces, therefore the "spaces" at…
Matt Weick
  • 332
  • 6
  • 19