What is sql injection? How to protect against sql injection attack?



What is sql injection? How to protect against sql injection attack?..

Answer / Manoj Meena

"SQL Injection" is a cyberattack where an attacker injects malicious SQL code into a SQL statement to gain unauthorized access or manipulate data. To protect against SQL Injection, use parameterized queries instead of building dynamic SQL statements from user input, and validate all user input for expected format and length.nnFor example, in C# using ADO.NET,nyou can use Parameters: n```csharpnSqlCommand cmd = new SqlCommand("SELECT * FROM Customers WHERE CustomerName = @CustomerName", conn);ncmd.Parameters.AddWithValue("@CustomerName", customerName);```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What area unit the various kinds of info compression introduced in sql server 2008?

1 Answers  


How to create a large table with random data for index testing in ms sql server?

1 Answers  


Is foreign key unique?

1 Answers  


what is the information that can be stored inside a bit column? : Sql server database administration

1 Answers  


What is a join and their types?

2 Answers   Challenger Financial,


Difference between Cluster and Non-cluster index?

32 Answers   Accenture, Agility e-Services, eClinicalWorks, HCL, Infosys, Oracle, Satyam, Yardi,


How to copy data from one table to another table?

1 Answers  


What is a mutating table error and how can you get around it?

1 Answers  


What are page splits? : SQL Server Architecture

1 Answers  


What are the steps you must follow to hide sql server instances?

1 Answers  


What is the difference between delete and truncate statements?

1 Answers  


What is the function of inner join?

1 Answers  


Categories