MS SQLServer Questions and Answers
1. What is SQL Injection?
|SQL Server provides a graphical tool which helps system administrators to monitor T-SQL statements of Database Engine. -SQL Profiler can capture and store data related to every event to a file or a table.|
2. What is Trigger?
|In SQL the Trigger is the procedural code that executed when you INSERT, Delete or UPDATE data in the table. -Triggers are useful when you want to perform any automatic actions such as cascading changes through related tables, enforcing column restrictions, comparing the results of data modifications and maintaining the referential integrity of data across a database.|
3. What is Normalization of database? What are its benefits?
|Normalization is set of rules that are to be applied while designing the database tables which are to be connected with each other by relationships. This set of rules is called Normalization. -Benefits of normalizing the database are 1. No need to restructure existing tables for new data. 2. Reducing repetitive entries. 3. Reducing required storage space 4. Increased speed and flexibility of queries.|
4. What is BCP? When does it used?
|BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user-specified forma|
5. What is DBCC?
|DBCC stands for Database Consistency Checker. These commands are used to check the consistency of the database like validation tasks, maintenance and status checks.|
6. What is PRIMARY KEY?
|A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity.|
7. What is FOREIGN KEY?
|A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values. A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value. The foreign key constraints are used to enforce referential integrity.|
8. What is UNIQUE KEY constraint?
|A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.|
9. What is CHECK Constraint?
|A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.|
10. What are the authentication modes in SQL Server? How can it be changed?
|Windows mode and Mixed Mode - SQL and Windows. To change authentication mode in SQL Server click Start, Programs, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page.|