Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

How I compare strings that are longer than 4000 characters IN MSSQL 2000, Please help me


Hi all,
I use MSSQL 2000.
In QueryAnalyzer, I wrote belows:
=============== Code ===============

CREATE TABLE t1(
       [col1] ntext NULL,
       [id] int identity(1,1) PRIMARY KEY
)

INSERT INTO t1 (col1) SELECT REPLICATE('u',4000)
INSERT INTO t1 (col1) SELECT REPLICATE('u',4001)

SELECT * FROM t1 WHERE col1 LIKE col1

-------------------------------------------------- result is :
col1                  id
------------------      ------
uuuuuuuu...       1

====================================

the LIKE operator seems not to work on strings that are longer than
4000 characters.
But my work uses thousands of characters in one string and
I need to do many actions on them, comparing for example.

How I compare these string values. Help me, please. It is vital for
me!!!

... Orgil

Orgil
If you want to display all characters go to Tools--Option  menu in QA and
then to Result Tab and specify max characters per column

"Orgil" <orgi@yahoo.com> wrote in message

news:1181023147.205733.267910@p47g2000hsd.googlegroups.com...

Thank you Uri.

I need a help on only comparing two strings that are longer than 4000
characters.

INSERT INTO t1 (col1) SELECT REPLICATE('u',4000)
INSERT INTO t1 (col1) SELECT REPLICATE('u',4001)

"SELECT * FROM t1 WHERE col1 LIKE col1 " this query results only one
row while there are two rows have to be resulted actually.
I thought that the LIKE operator doesn't work on string values that
are longer than 4000 characters.
But I have string values that are longer 4000 characters and need to
compare each other these values.

Orgil
SELECT id,[col1] FROM t1 WHERE datalength(col1) >=4000

"Orgil" <orgi@yahoo.com> wrote in message

news:1181027408.536722.6400@q66g2000hsg.googlegroups.com...

On Mon, 04 Jun 2007 22:59:07 -0700, Orgil <orgi@yahoo.com> wrote:
>the LIKE operator seems not to work on strings that are longer than
>4000 characters.

I could find nothing in the SQL Server 2000 documentation about this
but in the 2005 documentation it says the pattern is limited to 8000
bytes, which is 4000 characters when using unicode as in your example.
So the limit is not on the length of the string being searched, but on
the pattern that is being searched for.

Roy Harvey
Beacon Falls, CT

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc