26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

√<br />

AFTER triggers<br />

AFTER triggers execute following the SQL action, such as an insert, update, or delete.This<br />

is the traditional trigger which existed in SQL SERVER.<br />

INSTEAD OF triggers gets executed automatically before the Primary Key and the Foreign<br />

Key constraints are checked, whereas the traditional AFTER triggers gets executed after<br />

these constraints are checked.<br />

Unlike AFTER triggers, INSTEAD OF triggers can be created on views.<br />

(A)If we have multiple AFTER Triggers on table how can<br />

we define the sequence of the triggers ?<br />

If a table has multiple AFTER triggers, then you can specify which trigger should be<br />

executed first and which trigger should be executed last using the stored procedure<br />

sp_settriggerorder. All the other triggers are in an undefined order which you cannot<br />

control.<br />

(A)What is SQl injection ?<br />

It is a Form of attack on a database-driven Web site in which the attacker executes<br />

unauthorized SQL commands by taking advantage of insecure code on a system connected<br />

to the Internet, bypassing the firewall. SQL injection attacks are used to steal information<br />

from a database from which the data would normally not be available and/or to gain<br />

access to an organization’s host computers through the computer that is hosting the<br />

database.<br />

SQL injection attacks typically are easy to avoid by ensuring that a system has strong<br />

input validation.<br />

As name suggest we inject SQL which can be relatively dangerous for the database.<br />

Example this is a simple SQL<br />

SELECT email, passwd, login_id, full_name<br />

FROM members<br />

WHERE email = 'x'<br />

Now somebody does not put “x” as the input but puts “x ; DROP TABLE members;”.<br />

So the actual SQL which will execute is :-<br />

215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!