Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a regular expression

Status
Not open for further replies.

jeepxo

Programmer
Oct 1, 2002
228
CA
Blah blah blah long story.
Here's the gist of it.

inserting some stuff into a SQL database, it fails on a number of data sets because some fields are bigger then 8060 characters. When I print the string, the biggest variable is only 1104 characters, so I am guessing that there is some "encoding" that I'm not seeing.

I'm looking for a reg ex that will strip away anything that isn't an alphanumeric character, a space from a spacebar or these characters `<>/?-_

I know there are a number of guys out there that love creating regular expressions so I am hoping that you'll jump on this one and help me out.

&quot;Every day is like a precious gift, you have to make it count&quot; James Birrell 1993-2001
 
SQL Server has a limitation of 8060 bytes per row. Meaning that the cumulative lengths of your data added together cannot exceed 8060 bytes.

Of course, there are things you can do to resolve this problem, but none of them will be fun.

1. If you are using any char, nchar, or nvarchar fields, you should convert them to varchar. This assumes that you do not need support for unicode strings (to represent the chinese alphabet and such).

2. You could create additional tables to store the data, then link the tables on a primary key column.

3. You could convert your char/nchar/varchar/nvarchar fields to text (or ntext). This should be a last resort because many of the SQL Server string manipulation functions don't work with text or ntext.

Hope this helps.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top