Solved

Searching a nText column using LIKE

Posted on 2004-10-11
1
276 Views
Last Modified: 2012-08-13
Hello,

I have the following stored procedure:
------------------------------------------------------------------------------------------------------------------------
CREATE PROCEDURE [spSearchContent]
      (@userid      [uniqueidentifier],
       @search      [nText])
AS
SELECT     dbo.User_Loc_Relation.user_id, dbo.User_Loc_Relation.location_id, dbo.Content.title_id, dbo.Content.title, dbo.Content.content
FROM         dbo.Content INNER JOIN
                      dbo.User_Loc_Relation ON dbo.Content.location_id = dbo.User_Loc_Relation.location_id
WHERE
       dbo.Content.content LIKE '%' + @search + '%'
GO
------------------------------------------------------------------------------------------------------------------------

But it does not seem to like the WHERE clause.  Where am I going wrong?

Thanks in advance
0
Comment
Question by:rudyflyer
1 Comment
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 150 total points
ID: 12278376
LIKE only works with char, nchar, varchar, and nvarchar datatypes.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now