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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Best way to store text in SQL Server for ASP pages
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cyberdog
Starting Member

8 Posts

Posted - 02/08/2003 :  18:55:48  Show Profile  Reply with Quote
The article "Best way to store text in SQL Server for ASP pages?" states the varchar field can hold text much greater than 8000 characters without any problems during updates and select calls. Is this true?

Thanks,

Cj

Merkin
Funky Drop Bear Fearing SQL Dude!

Australia
4970 Posts

Posted - 02/08/2003 :  19:24:04  Show Profile  Visit Merkin's Homepage  Reply with Quote
I think you might want to re-read that. I can't see where it says that.

Varchar can not hold more than 8000 characters. Also, when sizing a varchar field you have to consider what other columns you have in the table. If you have other columns, then you can not use the entire 8000 characters in a varchar or your record will not insert.

Damian
Go to Top of Page

rrb
SQLTeam Poet Laureate

Australia
1479 Posts

Posted - 02/09/2003 :  18:33:34  Show Profile  Reply with Quote
quote:

If you read books online they tell you that text fields of 8,000 characters or less are very easy to handle but if you go over the 8,000 character limit you have to use all these special functions which are different for OLE DB, ODBC, ADO and DB-Lib (if anyone here remembers DB-Lib). Balderdash! In my youthful innocence I created a 55,000 character text field using an ASP page (I used TEXTAREA). I passed this using a POST to another ASP page and called a stored procedure passing my 55,000 character field as a parameter. It got passed and INSERTed just fine.


you can only insert up to 8060 bytes per row, (unless you use text fields) and since each varchar = 1 byte - ...

Cheers

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

cyberdog
Starting Member

8 Posts

Posted - 02/10/2003 :  22:08:03  Show Profile  Reply with Quote
Sorry for the delayed response.

I was actually looking for some SQL code for building a SPROC for searching large "Text" fields when I scanned that article quickly. I previously knew about the varchar limitations and after coding for 18 hours straight my mind was totally fried.

Thanks for the responses!
Go to Top of Page

rrb
SQLTeam Poet Laureate

Australia
1479 Posts

Posted - 02/10/2003 :  22:10:31  Show Profile  Reply with Quote
Cheers

sorry if my post sounded a little 'terse' - not intended.

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000