To begin with I want to say that I’m aware that this could be solved by column datatype changes in the database, but that is not an option, since the database is from an older system which is not under my control.
I want to query the database and find something like:
where Field1<>@Field1Value Or Field2<>@Field2Value
Where Field1 and Field2 are nvarchar and ntext columns.
Is there a way to do this with SQL?
Thank you.
LIKEis the operator you are looking for.You can simply query your columns using:
This will return the same results as
<>does for other columns.By the way, the
ntext datatypewill no longer be supported in future sql-server versions.See MSDN ntext deprecated