From the course: CCSP Cert Prep: 4 Cloud Application Security

Unlock the full course today

Join today to access over 24,300 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 a precompiled 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 businesses' customers. I can write a SQL query to show me all of the customers located in the state of Texas. I'll write select star from the customers table where the customer state equals Texas, and when I execute this code I see…

Contents