Kaporch
asked on
SQL Server 2000- new line/return character appearing as square boxes
I'm trying to do a comparison between a field in the database and a field on my data entry form. It contains some new line and return characters. In the text box, those characters are appearing as /n and /r, but in the database, they're being stored as what appears to be boxes. Does anybody know how to do the comparison for these characters? The field is being stored as varchar(8000).
Look for ascii values of 10 and 13, respectively
In SQL Server, they are stored as CHAR(10) and CHAR(13).
For comparison, you could probably do something like
IF REPLACE(dbColumn, CHAR(10)+CHAR(13),'') = REPLACE(txtString, '/n/r', '')
BEGIN
... -- code if equal
END
ELSE
BEGIN
... -- code if unequal
END
For comparison, you could probably do something like
IF REPLACE(dbColumn, CHAR(10)+CHAR(13),'') = REPLACE(txtString, '/n/r', '')
BEGIN
... -- code if equal
END
ELSE
BEGIN
... -- code if unequal
END
ASKER
The replace didn't work. They're still computing as not being equal.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you post the contents of the db field and the form field so we can see what should be considered equal?