Author |
Topic |
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 03:27:47
|
is there any datatypes in Microsoft SQL Server 2000 which has maximum length over 1000 characters ?because i wanna saved a large description that can be deleted or be editted ..please help me ..thank you beforeregards , Aldi |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-10-18 : 03:29:30
|
yes. the max length for varchar is 8000 KH[spoiler]Time is always against us[/spoiler] |
|
|
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 03:56:58
|
most of people in the internet are said "255" characters for varchar ?i'm confused with it |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 04:16:38
|
you can use text if you want to store data more then 8000 characters but keep in mind that it wont support some of normal string handling functions------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-10-18 : 04:17:01
|
Nope. It is 8000. According to the Books Online for SQL Server 2000quote: char[(n)]Fixed-length non-Unicode character data with length of n bytes. n must be a value from 1 through 8,000. Storage size is n bytes. The SQL-92 synonym for char is character.varchar[(n)]Variable-length non-Unicode character data with length of n bytes. n must be a value from 1 through 8,000. Storage size is the actual length in bytes of the data entered, not n bytes. The data entered can be 0 characters in length. The SQL-92 synonyms for varchar are char varying or character varying.
http://msdn.microsoft.com/en-us/library/aa258242%28v=sql.80%29.aspx KH[spoiler]Time is always against us[/spoiler] |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-10-18 : 04:27:17
|
quote: Originally posted by aldiwahyu most of people in the internet are said "255" characters for varchar ?i'm confused with it
I guess they have been given you the wrong information. For SQL Server related questions, you should visit a reputable site like this KH[spoiler]Time is always against us[/spoiler] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 04:28:52
|
quote: Originally posted by aldiwahyu most of people in the internet are said "255" characters for varchar ?i'm confused with it
can you post one such reference?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 04:38:43
|
well , what about text datatypes , is it edittable ?i want to make a long description, and i don't know what's the proper datatypes |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 05:11:21
|
its editable but only thing is updation is not as straightforward as normal character data types------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 05:21:35
|
i'm still confused, how to edit text type , and what about '255' in the varchar and whats about '8000' ?i'm very confused |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 05:32:06
|
where do you want to edit the text value?255,8000 etc represent maxlength of varchar fields------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 05:41:42
|
i wanna edit the text value through visual basic 6.0uh , i see, is 8000 characters = 255 byte ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-18 : 05:43:56
|
even if its text you can update it from vb. you need to use UPDATETEXT in code behind.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Kristen
Test
22859 Posts |
Posted - 2011-10-18 : 05:44:17
|
You would be much better to upgrade to newer version of SQL Server. SQL 2005, 2008 and 2008R2 (latest version) support VARCHAR(MAX) which has "unlimited" length.Using TEXT, which was the only "unlimited" length character datatype in SQL 2000, has lots of limitations and is a PITA to use compared to the new VARCHAR(MAX) - which behaves just like an ordinary VARCHAR datatype, in programming use (physical storage is different to normal VARCHAR, but that should not concern you).By comparison TEXT will give you trouble in Triggers, string handling, and all sorts of other places.If your descriptions will all be less than 8,000 characters you can use VARCHAR ... but there is a limit, in SQL 2000, on the total length of a row - so ig you have several VARCHAR(8000) columns in a single table the overal length of the row is limited - that's although good reason to upgrade as that is no longer a limitation in SQL2005/2008 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-10-18 : 05:51:54
|
quote: Originally posted by aldiwahyuuh , i see, is 8000 characters = 255 byte ?
8000 characters = 8000 bytes KH[spoiler]Time is always against us[/spoiler] |
|
|
aldiwahyu
Starting Member
7 Posts |
Posted - 2011-10-18 : 06:08:30
|
thank you for your information , this forum is very prizeable :Dthank you for all who helps me , i'll try it , i'll ask again if i meet any difficulties again |
|
|
|