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
Solved

Searching a nText column using LIKE

Posted on 2004-10-11
1
304 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL 10 35
Nested Case statement 4 38
RESTORE A BACKUP IN SQL 2012 from SQL 2008 9 65
query linked sql table field from access 4 22
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

829 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