Pragam
asked on
varchar length
I am facing a problem with the varchar data type in Microsoft SQL Server 7.0
Whenever I use this datatype its length doesnot automatically increases to accomodate the characters although they are less than 100 characters let alone 8K limit.
Even after repeated tries I am unable to make the length flexible.
Please advise
Whenever I use this datatype its length doesnot automatically increases to accomodate the characters although they are less than 100 characters let alone 8K limit.
Even after repeated tries I am unable to make the length flexible.
Please advise
When you define a column, the length you specify specifies the maximum length that column can reach. For example:
CREATE TABLE anyTable (col1 VARCHAR(50))
col1 cannot exceed 50 characters; SQL will not automatically increase the max length of the column to allow it tho hold more data, it will simply truncate (chop off) the value.
CREATE TABLE anyTable (col1 VARCHAR(50))
col1 cannot exceed 50 characters; SQL will not automatically increase the max length of the column to allow it tho hold more data, it will simply truncate (chop off) the value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
By the way, if you don't specify a length, it will default to ONE (except in CAST/CONVERT, in which case it defaults to 30).
Pragam:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
Declare @Variable varchar(8000)
Otherwise try posting your code.
Anthony