Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3809500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:18:54+00:00 2026-05-19T15:18:54+00:00

so i have a table lets say call it tbl.items and there is a

  • 0

so i have a table lets say call it “tbl.items” and there is a column “title” in “tbl.items” i want to loop through each row and for each “title” in “tbl.items” i want to do following:
the column has the datatype nvarchar(max) and contains a string…

  1. filter the string to remove words like in,out, where etc (stopwords)
  2. compare the rest of the string to a predefined list and if there is a match perform some action which involves inserting data in other tables as well..

the problem is im ignotent when it comes to writing T-sql scripts, plz help and guide me how can i achieve this?
whether it can be achieved by writing a sql script??
or i have to develope a console application in c# or anyother language??

im using mssql server 2008

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:18:55+00:00Added an answer on May 19, 2026 at 3:18 pm

    You want a few things. First, look up SQL Server’s syntax for functions, and write something like this:

    -- Warning! Code written off the top of my head,
    -- don't expect this to work w/copy-n-paste
    create function removeStrings(@input nvarchar(4000))
    as begin
        -- We're being kind of simple-minded and using strings
        -- instead of regular expressions, so we are assuming a
        -- a space before and after each word.  This makes this work better:
        @input = ' ' + @input
    
        -- Big list of replaces
        @input = replace(' in ','',@input)
        @input = replace(' out ','',@input)
        --- more replaces...
    end
    

    Then you need your list of matches in a table, call this “predefined” with a column “matchString”.

    Then you can retrieve the matching rows with:

    select p.matchString
      from items i
      join predefined p 
        on removeStrings(i.title) = p.matchString
    

    Once you have those individual pieces working, I suggest a new question on what particular process you may be doing with them.

    Warning: Not knowing how many rows you have or how often you have to do this (every time a user saves something? Once/day?), this will not exactly be zippy, if you know what I mean. So once you have these building blocks in hand, there may also be a follow-up question for how and when to do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a table of messages that users have sent, each with
Let's set the stage, PHP & MYSQL: I have a table we'll call Directions
Lets say you have 3 or 4 site features like photos, videos, wall posts,
Lets say I have some object that I've defined elsewhere. Maybe it represents a
I have an affiliate link with a product image http://www.myaffiliate.com/products/product.jpg I want to copy
What i want, to display rows from a table which is selected by a
I have seen MySQL triggers mentioned and I am curious whether they could be
I'm working on creating a dashboard. I have started to refactor the application so
Seems like this should be easy or at least documented somewhere, I just cant
I'm trying to design a MySQL database to store user zipcode preferences for providing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.