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
 Site Related Forums
 Article Discussion
 Best way to store text in SQL Server for ASP pages

Author  Topic 

cyberdog
Starting Member

8 Posts

Posted - 2003-02-08 : 18:55:48
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!

4970 Posts

Posted - 2003-02-08 : 19:24:04
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

1479 Posts

Posted - 2003-02-09 : 18:33:34
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 - 2003-02-10 : 22:08:03
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

1479 Posts

Posted - 2003-02-10 : 22:10:31
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
   

- Advertisement -