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

  • Home
  • SEARCH
  • 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 3606402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:14:37+00:00 2026-05-18T21:14:37+00:00

I am working with SQL Server 2005. I need to select all rows from

  • 0

I am working with SQL Server 2005. I need to select all rows from a table that have the same string as a given parameter.

SELECT * FROM mytable WHERE title LIKE @param;

The only problem is that the title column may contain special chars that have already been replaced by ‘-‘ in the compared @param.

Any char in @param except [a-z][A-Z][0-9][-] got replaced by ‘-‘, so there is no way to reverse this. (the value comes from a SEO friendly url)

Examples for possible title values and how they should look like:

"Adobe Acrobat" -> "Adobe-Acrobat"  
"A+® Certification" -> "A-Certification"

I cannot use the SQL REPLACE() function as I need a white-listing mechanism for the chars. There might be very special chars in the title column which I cannot predict.

Regular Expressions would be perfect for this.

I searched for 2 days now but couldnt find an easy and efficient way to implement it in T-SQL.

I could get all rows and do the filtering in the client code, but that doesn’t seem to be a very good solution to me.

Any suggestions?

  • 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-18T21:14:38+00:00Added an answer on May 18, 2026 at 9:14 pm

    If you are using SQL Server 2005 and above, you can use SQL CLR functions to use regex efficiently within SQL Server.

    There is a download available for a RegEx SQL CLR here, with source code.

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

Sidebar

Related Questions

I'm working in Sql Server 2005. I have an event log table that tracks
I am working with SQL Server 2005 and I have trigger on a table
Working in SQL Server 2005, I have a stored procedure that inserts a record
I'm working on SQL server 2005 and I have a very simple stored procedure:
I am working on a query for SQL Server 2005 that needs to return
I have a database working in my local sql server 2005 express edition. I
I am working on the Full Text Search in Sql Server 2005. I have
In SQL SERVER 2005 This query works fine : Select * from sys.procedures where
I am working with SQL Server 2005. I need to find out only those
I'm working with pyODBC communicate with a MS SQL 2005 Express server. The table

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.