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


Please Help Members By Posting Answers For Below Questions

How do I create a trace in sql server?

1120


Where can you add custom error messages to sql server?

1211


How do I find query history in sql server?

1024


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

1133


What is an indexed view?

1022


Is it possible to have clustered index on separate drive from original table location?

1040


Explain system functions or built-in functions? What are different types of system functions?

1065


What is self contained sub query?

1140


what is the Ticketing tool used in Wipro technologies at Bangalore...???

8230


How to enter binary string literals in ms sql server?

1244


What is acid mean in sql server?

1245


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

1023


Can one drop a column from a table?

1089


What kind of problems occurs if we do not implement proper locking strategy?

1499


What are the kinds of subquery?

1107