Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2007
    Posts
    1

    Unanswered: How do I return results using an entire column as part of the search parameter

    Hi, Could you tell me if this is possible? How do I return results using an entire column as part of the search parameter? I need to do this in the sql rather than selecting the contents and iterating through it as it would take too long.

    eg.
    CREATE TABLE [dbo].[tPopupKeywords](
    [id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
    [title] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [description] [nvarchar](2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
    ) ON [PRIMARY]


    INSERT INTO dbo.tPopupKeywords(title, description)
    SELECT 'check', 'desc' UNION ALL
    SELECT 'for', 'desc' UNION ALL
    SELECT 'keywords', 'desc'


    select dbo.tpopupkeywords.title
    where 'This is an example of a passed in string to check if any keywords are returned.'
    LIKE '% ' + dbo.tpopupkeywords.title + ' %' --Does this bit need to do a select??

    expected results.....:

    check
    keywords

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I'm not sure I get it - haven't you supplied the answer? You just missed off:
    from dbo.tpopupkeywords

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •