From the course: CompTIA Cybersecurity Analyst (CySA+) (CS0-003) Cert Prep

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Parameterized queries

Parameterized queries

- [Instructor] Parameterized queries offer another approach that protects applications against injection attacks. In a parameterized query, the client does not directly send SQL code to the database server. Instead, the client sends arguments to the server, which then inserts those arguments into pre-compiled query template. This approach protects against injection attacks and also improves database performance. Stored procedures are an example of an implementation of parameterized queries used by some database platforms. Let's take a look at an example. I'm using Azure Data Studio to access a SQL server database. This database has a table called Customers that contains contact information for a business' customers. I can write a sequel query to show me all of the customers located in the state of Texas. I'll write SELECT # from the customer's table where the customer's state equals Texas. And when I execute this code, I see all the information about the six customers who live in the…

Contents