1.Describe way(s) to tune the SQL table in order to
optimize performance.
2. Explain SQL Injection and how can you prevent them?
Answer Posted / 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 View All Answers
Explain view in sql server?
What is equi join with example?
What are “phantom rows”?
What is difference between count (*) and count column?
how can a database be repaired? : Sql server administration
Tell me what is difference between view and materialized view?
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
What stored by the msdb?
What is a full text index?
Explain features of analysis services?
How many types of functions are there in sql server?
how to overcome kernel isssues
What is the fastest way to permanently delete a 1 million row table named customers?
Where in ms sql server is ’100’ equal to ‘0’?
How to query multiple tables jointly?