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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:25:12+00:00 2026-05-27T16:25:12+00:00

While I can certainly see the advantages of using parameters for SQL queries, especially

  • 0

While I can certainly see the advantages of using parameters for SQL queries, especially when dealing with datetimes and things like that, I’m still unsure about parameters as the only way to prevent SQL injection.
The fact is, I inherited an application and it has things like

"SELECT Field FROM Table WHERE Filter='"+userinput.Replace("'", "''")+"'"

all over the place. Now while those doesn’t look very pleasant to my eyes, and I wouldn’t mind rewriting them, my question is, do I need to? Try as I might, I can’t see a way to perform SQL injection with 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-27T16:25:13+00:00Added an answer on May 27, 2026 at 4:25 pm

    No, it is not enough. It will do in a pinch, but it is a very weak alternative, and using parameterized queries or parameterized stored procedures is better, if your platform and/or RDBMS support either feature.

    From

    OWASP’s SQL Injection Prevention Cheat Sheet

    …this methodology is frail compared to using parameterized queries.
    This technique should only be used, with caution, to retrofit legacy
    code in a cost effective way.

    There are more below

    SQL injection — but why isn’t escape quotes safe anymore?

    Sql Injection Myths and Fallacies

    SQL Injection after removing all single-quotes and dash-characters

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

Sidebar

Related Questions

After using them a while I can't help but feel that the hoops you're
I've been wondering about this for a while and I can't see why Google
I want to know how can i fill only certain columns while filling the
I googled for this for a while but can't seem to find it and
I've looked on the web for a while and can't seem to find the
I bet this is easy but been trying for a while and can't seem
My knowledge of Lambda expressions is a bit shaky, while I can write code
I researched this a while ago and can't remember how to do it. I
Is there anything I can do while coding in Asp.net to make my website
While for the most part you can generate the same MSIL, there are definitely

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.