Can you force a user input in a SQL statement, then have the statement continue running

5 pts.
Tags:
SQL
SQL Server development
SQL statements
Hi, can one in an SQL statement, when running in SQL, force a user input to be entered and when entered? The SQL continues to complete.

Answer Wiki

Thanks. We'll let you know when a new response is added.

It’s probably possible if you give users direct access to the SQL CLI prompt, but that’s a very bad idea. What are you trying to accomplish, specifically? You should always take in input, make sure to sanitize it, and only then incorporate it into the SQL command and run that.

xkcd has a humorous but real example of the huge security problems you introduce by not properly sanitizing input.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Microsoft SQL Server doesn't provide a way to do this. All inputs have to be supplied by the user before the code is executed against the database. If you are using Oracle however it can prompt the user for input when using SQLPlus. (You didn't specify the platform you are using) What ever front end you are using should handle the input of data from the user. Let the database simply handle the data processing and storage.
    66,325 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following