Sql Server Interview Questions and Answers (1758) - Page 16

What is the difference between TRUNCATE and DELETE commands?

1.TRUNCATE is a DDL command whereas DELETE is a DML command.
2.DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back.
3.WHERE can be used with DELETE and not with TRUNCATE.
What are the privileges that can be granted on a table by a user to others?

Insert, update, delete, select, references, index, execute, alter, all
What are the wildcards used for pattern matching?

_ is used for single character substitution
% is used for multi­character substitution
Which command displays the SQL command in the SQL buffer, and then executes it?

RUN

It lists the commands in the SQL buffer before running and then execute (or re-execute) commands.
Which command executes the contents of a specified file?

START or @

 @ pathname
It will run a SQL Script.

Example:-
@Script1.sql parameter1 parameter2 parameter3


In the Script we can refer to the parameters as &1, &2, and &3.

Similarly @@ pathname will able to run a nested SQL Script.
Which operator performs pattern matching?

LIKE

SELECT * FROM student WHERE name LIKE '%Abhisek%'


The above command will retrieve records with name Abhisek in the name column.

We can use different wildcard characters to specify the condition.
How many maximum Clustered indexes on a table ??

NOTE: This is objective type question, Please click question title for correct answer.
What is fixed-length & variable-length characters? Tell me their differences??

In Sql Server there are two types of character data types. They are

1.fixed-length (i.e char)
2.variable-length (i.e varchar)

The main differences are maximum length and in whether trailing spaces are retained
What is Powershell ?

PowerShell is the .NET based automation engine in Microsoft p/f , it can be embedded into .NET applications but is usually used as a command line shell and scripting language.
What is SqlBulkCopy in ADO.NET?

SqlBulkCopy is the object that helps you to perform a bulk copy.
You can use a DataReader or DataTable as source data
store.
How do you map a column in SqlBulkCopy?

By the object of SqlBulkCopyColumnMapping class.
Following is a sample

SqlBulkCopyColumnMapping mapColumn1 =         new SqlBulkCopyColumnMapping("EmpID", "ID");

What is a cube?

A cube is a collection of measures and dimensions for analyzing the data in detail.

Here measure is the fact and it has the aggregate data and dimension is a group of attributes.
What is the full form of KPI?

Key Performance Indicators
In Analysis service what is the technology used define the expressions?

Multidimensional Expressions also abbrevated as MDX
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories