Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 datatype character limit

Author  Topic 

johnglynn
Starting Member

4 Posts

Posted - 2007-02-07 : 10:25:48
I am trying to store long text so I gave the field in question the TEXT datatype. But it only lets me store 1023 characters. I was expecting (but not quite needing) 2,147,483,647 characters when using the TEXT datatype. Can some one point out what I am missing.

Great forum, my first post, ahhh....

I will continue to search the forum for my answer. Thank you for taking the time to read this.

John

...uh, something like that...

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 10:29:36
"But it only lets me store 1023 characters"

You trying to enter the data in the Enterprise Manager "Grid" editor? That has a very short limit on the amount you can hand-edit in a field

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-07 : 10:29:59
What version of SQL Server are you using?

varchar can go up to 8000 bytes

text is more painful, since you need to read it in chunks, but at any rate, you should be able to store more than that in text easy enough

I'm guessing you're entering data in Enterprise Mangler.

How was space btw?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-07 : 10:30:46
quote:
Originally posted by Kristen

"But it only lets me store 1023 characters"

You trying to enter the data in the Enterprise Manager "Grid" editor? That has a very short limit on the amount you can hand-edit in a field

Kristen





Now cut that out....

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 10:33:49
"Now cut that out...."

That's just post-padding ....

... (unlike this!)
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-07 : 10:34:37
quote:
Originally posted by Kristen

"Now cut that out...."

That's just post-padding ....

... (unlike this!)




TEST



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

johnglynn
Starting Member

4 Posts

Posted - 2007-02-07 : 10:43:01
Holy cow, what a forum. The ink on my post is still wet and there are already half a dozen replies. Yes I was entering the text directly through EM. In the end the text will be coming in via coldfusion so I am assuming it can handle larger amounts dynamically?

There will likely be more than 8000 characters but far fewer than the 2 billion+ alotted to the TEXT datatype. Any suggestions?

Thank you one and all! Brett- space been verdy verdy good to me (:^)



...uh, something like that...
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-07 : 10:50:01
Well....what are you trying to store?

Images? Word Documents?

What version again?

If it's SQL Server 2005 you could use varchar(max)

I would not recommend using text



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 10:57:28
"In the end the text will be coming in via coldfusion so I am assuming it can handle larger amounts dynamically?"

Most probably. Almost anything shoveling "text" should the ADO layer works OK these days. Binary data might be more fraught, but if its "plain text" I doubt you will have a problem.

Worth testing your average-worst-case piece of large text though.

Kristen
Go to Top of Page

johnglynn
Starting Member

4 Posts

Posted - 2007-02-07 : 10:58:08
Thanks Brett,

Sorry, it is version 8.0 I will be storing just simple strings, no formatting.

...uh, something like that...
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-07 : 11:19:09
Suggestions?

Sure. Create a child table, with the Parents primary key and store many rows of varchar(8000) with a sequence number, and have the front end build and deconstruct the blocks of data. That would be the easiest.

MOO



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

johnglynn
Starting Member

4 Posts

Posted - 2007-02-07 : 11:21:52
ooh, clever. Thanks again, Brett!

...uh, something like that...
Go to Top of Page
   

- Advertisement -