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 550031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:14:47+00:00 2026-05-13T11:14:47+00:00

Is there a way to declare a list of items in an sql server

  • 0

Is there a way to declare a list of items in an sql server stored procedure using T-SQL and then loop through the items?

I’m trying to do something like this:

input_string = 'my dog has fleas.'
list_remove = 'a', 'e', 'i', 'o', 'u'

for each item in list remove
    input_string = replace(input_string, item, '')
end

And in the end input_string would be ‘my dg hs fls.’

I know we can create a table in a stored procedure. Is that the best way to do something like this?

  • 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-13T11:14:47+00:00Added an answer on May 13, 2026 at 11:14 am

    You have a few options. OMG Ponies is one. You can also use a table variable (@) or a temp table (#). The main difference between @ and # is that the @ table is a variable and stores the information in memory and the # table stores it in the temp database (in a way that allows for duplicates if 2 or more copies of the sp are running at the same time). You will find that if your table is larger than a few dozen records the @ table might become slow. This is because of how it is stored. Read this from Stackoverflow for more info. Also, you can use a while loop but if you plan on having a ton of columns in the temp table I would use a cursor, read the msdn article for more information. Cursors also allow you to move back and forth easily in your table. Also, if you want them to be fast just use the FAST FORWARD option which makes them roughly as fast as a WHILE loop in SQL.

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

Sidebar

Related Questions

Is there a way to do 'using' in XAML i.e. declare a namespace and
I'm trying to run a query from ADO.NET using SQL Server 2008R2. I'm using
Is there any way to declare a list object of anonymous type. I mean
I have the following SQL Server stored procedure: CREATE PROCEDURE ispsDcOhcAgg @TmpTableName NVARCHAR(50), @ListItem
I am trying to do things the .net way and declare my menu items
Is there a way to declare that the variable type of a generic class
Is there any way can declare a bean in just like JSP UseBean in
Is there a way to declare which signals are subscribed by a Python application
Is there a way to declare a variable with a particular user-defined type in
Is there a way to declare an unsigned int in Java? Or the question

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.