Solved

Searching a nText column using LIKE

Posted on 2004-10-11
1
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

728 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