Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 handling text larger than 1000 characters in SQL?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 09 August 2004 :  11:04:35  Show Profile  Visit D3mon's Homepage
How long can a VARCHAR field be?

I'm having all sorts of problems storing some articles which are quite long...


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 09 August 2004 :  12:30:18  Show Profile
It's the size of the row that is limited to 8kb. So you could have a table with 1 varchar(8000) column or 8 varchar(1000) columns.

The UK MkIVs Forum
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 09 August 2004 :  12:33:12  Show Profile  Visit D3mon's Homepage
Ah that makes sense.
Decided to use a 'text' field, and discovered thatstored procedures have problems with long text fields. Dropped the SP and used a standard Text Query - works a treat now!


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 09 August 2004 :  21:57:37  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
quote:
Originally posted by DavidRhodes

It's the size of the row that is limited to 8kb. So you could have a table with 1 varchar(8000) column or 8 varchar(1000) columns.



does nvarchar have the same problem?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 10 August 2004 :  01:54:13  Show Profile  Visit Jeepaholic's Homepage
What problems do stored procedures have with long text fields? I've never run into any issues myself... Other than the fact that MS SQL isn't optimized to search through them very well.

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight

Edited by - Jeepaholic on 10 August 2004 01:54:44
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 10 August 2004 :  04:39:50  Show Profile  Visit D3mon's Homepage
I got a syntax error when trying to retrieve the field via a Stored Procedure.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 10 August 2004 :  06:53:38  Show Profile  Send pdrg a Yahoo! Message
Nvarchar is unicode varchar with each screen character represented by 2 'programatic' characters, hence max is Nvarchar(4000) [4000 * 2 chars = 8k]

Re the syntax error, were you then trying to stuff 10k characters into a varchar (8000) datatype or something? that would truncate, and so leave the data in a confused condition
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 August 2004 :  09:48:24  Show Profile
quote:
Originally posted by Jeepaholic

What problems do stored procedures have with long text fields? I've never run into any issues myself... Other than the fact that MS SQL isn't optimized to search through them very well.



I use text and ntext with in stored procedures with no problems, I think the only thing you cannot do is set them as OUTPUT parameters, but I may be wrong.

Text, ntext, blob fields do not count as part of the 8Kb limit as they are stored seperately.

The UK MkIVs Forum
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 10 August 2004 :  10:16:26  Show Profile  Send pdrg a Yahoo! Message
strictly speaking, they do count towards the 8k limit, but only a few bytes as a pointer towards the appropriate page
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07