Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Searching a nText column using LIKE

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
rudyflyer
Asked:
rudyflyer
1 Solution
 
jdlambert1Commented:
LIKE only works with char, nchar, varchar, and nvarchar datatypes.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now