March 5, 2006 at 4:37 am
Hi!
Can some one give a short lesson about handling long data rows. I have 5000 rows which varies from 1200 to 9000 characters. What's the best way and most effectively way to handle these in Sql Server 2000? There are a qunique key data but the problem is the long character data which is needed to read like 'LIKE'.
Datatypes ? How to read? Can 'LIKE' to be used when reading?
Newbies problem.
March 5, 2006 at 2:10 pm
The question doesn't make much sense. Please provide some DDL if you want help. A "row" width is not calculated is number of characters, so I suppose you are refering to one column. The LIKE condition is intended for simple pattern matching on character strings. You can use it in many ways, including SELECT statements, but its purpose it to match rows not "read" them.
If you go beyond 8000 characters in one column you have no choice but to use the TEXT datatype with SQL 2000 and VARCHAR(MAX) with SQL 2005. You can use LIKE to search TEXT and VARCHAR columns that match your criteria. Look in the books on line for some examples; including uses of % _ [^-] in the pattern string.
If your needs are more complex, look at full text search (as a last resort only). Full text indexing can be a pain to configure and backup/restore with SQL 2000. Much easier with SQL 2005.
Hope it helps
March 6, 2006 at 3:57 am
One minor correction, a row size can be a limitation and since, for char and varchar, 1 character=1 byte can be measured in characters. SQL rows have a max size of 8060 bytes. If you want to go above that, you'll have to use text.
mirja: please post the definition of your table and some sample data so that we can take a look.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply