find uniqueidentifier's in text or ntext fields

Posted on 2006-05-15
Last Modified: 2006-11-18
hi experts

can anyoune help me?
I have an intranet which have RTF fields I store the content in ntext fields. There are also pictures in it reference to a record in the database like:


it's possible that a test can contain more than one of the above link (with different uniqueidentifiers).
Is it possible to "scan" every text field in off business hours to collect all uniqueidentifiers?

thank you
Question by:gumball_ch

    Author Comment

    the link clould be like that:

    <img src="/special/">
    LVL 142

    Assisted Solution

    by:Guy Hengel [angelIII / a3]
    >I have an intranet which have RTF fields I store the content in ntext fields.
    if you only store web calls like this, don't use NTEXT but NVARCHAR instead, because searching in NTEXT will be quite difficult....

    where yourfield like '%' + cast(uniqueidentifiervalue as varchar(50)) + '%'
    LVL 75

    Accepted Solution

    You can make use of the full text indexing fascilty. Follow the steps

    USE urDatabase
    1. sp_fulltext_database 'enable'

    2. sp_fulltext_table [ @tabname = ] 'qualified_table_name'
        , [ @action = ] 'action'
        [ , [ @ftcat = ] 'fulltext_catalog_name'
        , [ @keyname = ] 'unique_index_name' ]

    3. Once u have done all these Use 'CONTAINS' Statement to do the search

    SELECT Something
    FROM urTable
    WHERE CONTAINS(urIndexedColumnName, ' "String to seach " ')

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
    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…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    755 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

    21 Experts available now in Live!

    Get 1:1 Help Now