SQL
All the FAQS related to SQL
What is SQl injection ?
Jul 15th
An attack technique used to exploit web sites by altering backend SQL statements through manipulating application input.” - Web Application Security Consortium Glossary.
SQL Injection happens when a developer accepts user input that is directly placed into a SQL Statement and doesn’t properly filter out dangerous characters. This can allow an attacker to not only steal data from your database, but also modify and delete it. Certain SQL Servers such as Microsoft SQL Server contain Stored and Extended Procedures (database server functions). If an attacker can obtain access to these Procedures it may be possible to compromise the entire machine. Attackers More >
nolock? What is the difference between the REPEATABLE READ and SERIALIZE isolation levels?
Dec 13th
Locking Hints – A range of table-level locking hints can be specified using the SELECT, INSERT, UPDATE, and DELETE statements to direct Microsoft® SQL Server 2000 to the type of locks to be used. Table-level locking hints can be used when a finer control of the types of locks acquired on an object is required. These locking hints override the current transaction isolation level for the session.
What Is a Session?
Dec 7th
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
If we have multiple AFTER Triggers on table how can we define the sequence of the triggers ?
Dec 6th
If a table has multiple AFTER triggers, then you can specify which trigger should be executed first and which trigger should be executed last using the stored procedure sp_settriggerorder. All the other triggers are in an undefined order which you cannot control.
What are the different types of triggers in SQl SERVER 2000 ?
Dec 6th
There are two types of triggers :-
- INSTEAD OF triggers
INSTEAD OF triggers fire in place of the triggering action. For example, if an INSTEAD OF UPDATE trigger exists on the Sales table and an UPDATE statement is executed against the Salestable, the UPDATE statement will not change a row in the sales table. Instead, the UPDATE statement causes the INSTEAD OF UPDATE trigger to be executed, which may or may not modify data in the Sales table.
- AFTER triggers
AFTER triggers execute following the SQL action, such as an insert, update, or delete. This is the traditional trigger which existed in SQL SERVER.
INSTEAD More >
What is BCP utility in SQL SERVER ?
Dec 6th
BCP (Bulk Copy Program) is a command line utility by which you can import and export large amounts of data in and out of SQL SERVER database.
Below is a sample which shows BCP in action.
What are the different types of replication supported by SQL SERVER ?
Dec 6th
There are three types of replication supported by SQL SERVER:-
Snapshot Replication.
Snapshot Replication takes snapshot of one database and moves it to the other database. After initial load data can be refreshed periodically. The only disadvantage of this type of replication is that all data has to be copied each time the table is refreshed.
Transactional Replication
In transactional replication data is copied first time as in snapshot replication, but later only the transactions are synchronized rather than replicating the whole database.You can either specify to run continuously or on periodic basis.
Merge Replication.
Merge replication combines data from multiple sources into a single central More >
What is the purpose of Replication ?
Dec 6th
Replication is way of keeping data synchronized in multiple databases. SQL server replication has two important aspects publisher and subscriber.
Publisher
Database server that makes data available for replication is called as Publisher.
Subscriber
Database Servers that get data from the publishers is called as Subscribers.
What is DBCC?
Dec 6th
DBCC (Database Consistency Checker Commands) is used to check logical and physical consistency of database structure.DBCC statements can fix and detect problems.They are grouped in to four categories :-
- Maintenance commands like DBCC DBREINDEX , DBCC DBREPAR etc , they are mainly used for maintenance tasks in SQL SERVER.
- Miscellaneous commands like DBCC ROWLOCK , DBCC TRACEO etc , they are mainly used for enabling row-level locking or removing DLL from memory.
- Status Commands like DBCC OPENTRAN , DBCC SHOWCONTIG etc , they are mainly used for checking status of the database.
- Validation Commands like DBCC CHECKALLOC,DBCC CHECKCATALOG etc , they perform validation operations on database.
Note :- Check MSDN More >
