A3:2021 | SQL Injection Mitigation (2) |
Stored Procedures
Safe Stored Procedure (Microsoft SQL Server)
CREATE PROCEDURE ListCustomers(@Country nvarchar(30))
AS
SELECT city, COUNT(*)
FROM customers
WHERE country LIKE @Country GROUP BY city
EXEC ListCustomers ‘USA’Injectable Stored Procedure (Microsoft SQL Server)
CREATE PROCEDURE getUser(@lastName nvarchar(25))
AS
declare @sql nvarchar(255)
set @sql = 'SELECT * FROM users WHERE
lastname = + @LastName + '
exec sp_executesql @sqlStored Procedures in SQL
Stored Procedures in SQL
Safe Stored Procedure (Microsoft SQL Server)
Injectable Stored Procedure (Microsoft SQL Server)
PreviousA3:2021 | SQL Injection Mitigation (1) | Cycubics DocsNextA3:2021 | SQL Injection Mitigation (3) | Cycubix Docs
Last updated
Was this helpful?

