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
Is a null value equal to anything? Can a space in a column be considered a null value? Why or why not?
What does ss stand for sexually?
What is policy management?
Explain about integration services of Microsoft SQL server?
1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?
Explain partitioned view?
if no size is defined while creating the database, what size will the database have? : Sql server administration
What is mean by dml?
What is a livelock?
How to delete duplicate rows from table except one?
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
what is the system function to get the current user's user id? : Sql server database administration
What does asynchronous call backs means?
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
Is sql server implemented as a service or an application? : Sql server database administration