what is sql injection in sql server?
Answers were Sorted based on User's Feedback
Answer / venkat reddy.ravu
SQL injection is nothing but inserting malicious code with
the strings and later which will pass to the particular SQL
server instances which may damage the database or may
corrupt bthe data
For exaple:
var EmpName;
EmpName= Request.form ("EmpName");
var sql = "select * from Employee where EmpName= '" +
EmpName+ "'";
If you considers the above query and if user prompts to
enter the input as Scott,
Then query processed like this
select * from Employee where EmpName='Scott'
If user enters the input as below,
Scott,drop table Employee
In this case your query will be processed as below
select * from Employee where Ename='Scott',drop table emp
So,first select statement will be executed and then table
will be dropped.
Nothing but without standard of coding an expertised user
may damages or corrupt the databases.
To avoid SQL injection attacks:-
1)Use Parameterized Input with Stored Procedures
2)Use the Parameters Collection with Dynamic SQL
3)Filtering Input
4)LIKE Clauses
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / pankaj kumar
SQL injection is something where an end user of an application is able to submit SQL queries through the user interface and end up running those queries, causing potential damage to the database.
Is This Answer Correct ? | 1 Yes | 0 No |
How to Create Login and User through query in Sql server 2005.and also how to delete Login and User through query?
Tell me when is the update_statistics command used?
what are batch in sql server?
what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?
Which are the new data types introduced in sql server 2008?
Explain multiserver query
Write an sql query to find first weekday of the month?
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
What is updatable resultset?
How do you delete a data source?
How to verify the port number of the sql server?
What is difference between TRUNCATE and DELETE statement