adspace
What methods do you follow to protect from sql injection attack?
Answer Posted / Shobhit Asthana
To protect against SQL Injection attacks, here are some methods followed in SQL Server:
1. Parameterized Queries: Use parameterized queries instead of concatenating user input directly into SQL statements.
2. Stored Procedures: Use stored procedures to validate and sanitize user input before using it in a query.
3. Prepared Statements: Similar to parameterized queries, prepared statements also help protect against SQL Injection attacks.
4. Least Privilege Principle: Grant the least amount of permissions needed for a task to the user or application.
5. Use of Dynamic SQL with Caution: While dynamic SQL is useful, it can be risky if not used carefully. Always sanitize user input before using it in dynamic SQL statements.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I create a trace in sql server?
Where can you add custom error messages to sql server?
How do I find query history in sql server?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
What is an indexed view?
Is it possible to have clustered index on separate drive from original table location?
Explain system functions or built-in functions? What are different types of system functions?
What is self contained sub query?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
How to enter binary string literals in ms sql server?
What is acid mean in sql server?
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
Can one drop a column from a table?
What kind of problems occurs if we do not implement proper locking strategy?
What are the kinds of subquery?