1.Describe way(s) to tune the SQL table in order to
optimize performance.

2. Explain SQL Injection and how can you prevent them?



1.Describe way(s) to tune the SQL table in order to optimize performance. 2. Explain SQL Inject..

Answer / jerry joseph

1. identify and create optimal indexes for your tables

every table should have at least a clustered index

Indexes should be considered on all columns that are
frequently accessed by the WHERE, ORDER BY, GROUP BY, TOP,
and DISTINCT clauses

Static tables can be more heavily indexed that dynamic tables

2. An SQL Injection attack is a form of attack that comes
from user input that has not been checked to see that it is
valid. The objective is to fool the database system into
running malicious code that will reveal sensitive
information or otherwise compromise the server.

Example:
StrSQL = "SELECT * from Users WHERE username = '" +
txtUserName.Text + "' AND password = '" + txtPassword.Text +
"'";
if txtUserName is entered as "admin' OR 1 = 1;--" the query
becomes
"SELECT * from Users WHERE username = 'admin' OR 1 = 1;--'
AND password = '" + txtPassword.Text + "'"
user logs in as admin

Prevention :
Use Parameterized Queries or Stored Procedures to prevent
SQL Injection.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is a rownum?

0 Answers  


What is the joins and how many types of Joins in sql server a diffrentiate ever one give a suaitable query

2 Answers   Apollo,


What is indexed view?

0 Answers  


How to automatically create a log when an exception is being received into SQL Server?

0 Answers   Cap Gemini,


What is filter index?

0 Answers  






What are the different Authentication modes in SQL Server and how can you change authentication mode?

0 Answers  


In which year relase the 7.0& 2000 & 2005?

1 Answers  


write a query to remove duplicate records without using primary key column?

2 Answers   ABCO,


Can we execute a stored procedure inside a trigger?

6 Answers   BirlaSoft, CarrizalSoft Technologies, United Healthcare,


What is tablesample?

0 Answers  


SQL Server Architecture ?

0 Answers   IBM, Sapient,


Can you explain the types of Joins that we can have with Sql Server?

2 Answers  


Categories