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

What is the use of xml datatype in SQL Server?

As the name indicates xnl datatype is used to store XML documents in SQL Server.

For more information please go to the following URL,
http://msdn.microsoft.com/en-us/library/ms187339.aspx
What is the maximum size of data we can store in the image type of SQL?

We can store binary data from 0 to 2^31-1 or 2,147,483,647 bytes in an image field of SQL Server. The image datatype is used to store images and files in a database.
What is the difference between .rdl and .rdlc report.

.rdl report is created using SQL Server Reporting service, But the .rdlc report is created with the help visual studio's inbuilt reporting services. in rdlc 'c' stands for client side.
Can we create DTS Package in DTS package in SQL Server 2005 or higher version?

NOTE: This is objective type question, Please click question title for correct answer.
What is SSIS

SSIS is know as SQL Server Integration service. SSIS Package are replacement of DTS Package in SQL Server 2005 or higher version.
Can we write Scripting Language like VB Script and JavaScript in SSIS Package?

Yes, We can Write VB Script and JavaScript in SSIS Packages using ActiveX Task Control.
Name of the containers in SSIS?

(1) Task Host Containers
(2) Sequence Containers
(3) ForEach Loop Containers
(4) For Loop Containers
Can we use Oracle Database as source or destination Database in SSIS?

Yes, We can Use Oracle Database and can create OLE-DB Connection to connect.
Adding months to a Date in SQL ??

Example below illustrates :

Select DATEADD(mm,1,getdate())

Adding minutes to a date ??

Example below illustrates :

Select DATEADD(minute,1,getdate())

Adding year to a date ??

Example below illustrates :

Select DATEADD(year,1,getdate())

How to get the month value/month part from the given Date?

There are three methods to get the Month part from given date:
DECLARE @GivenDate datetime
SET @GivenDate='2010-02-22 23:06:38.300'
(1) MONTH(GETDATE()) OutPut: 2
(2) SUBSTRING(CONVERT(varchar(30),GETDATE(),107),1,3) Output: Feb
(3) DatePart(M,GETDATE()) output: 2
How to get the Day part from the given Date?

There are two methods to get the Date part from given date:
DECLARE @GivenDate datetime
SET @GivenDate='2010-02-22 23:06:38.300'

(1) DAY(GETDATE()) Output: 22
(2) DatePart(d,GETDATE()) Output: 22
How to get the year part from the given Date?

There are two methods to get the Year part from given date:
DECLARE @GivenDate datetime
SET @GivenDate='2010-02-22 23:06:38.300'

(1) Year(GETDATE()) Output: 2010
(2) DatePart(yy,GETDATE()) Output: 2010
How to get the number of quarter from given date?

There is one method to get the Quarter number from given date:
DECLARE @GivenDate datetime
SET @GivenDate='2010-02-22 23:06:38.300'

SELECT DatePart(Q,GETDATE())
Output: 1
Which function is used to convert the integer value into spaces?

The SPACE function convert the specified integer value into spaces.

SELECT SPACE(4)

It will output a string of four spaces " ".
Which function performs the opposite function of CEILING function in SQL Server?

NOTE: This is objective type question, Please click question title for correct answer.
Why FLOOR function is used?

FLOOR function is used to roundup a non integer number to the next least integer.
Syntax:-
FLOOR(expression) 

Example:-
SELECT FLOOR(355.34) FROM dual;

It will output 355. If we will pass a positive no. it will return only the integer part.

SELECT FLOOR(-355.34) FROM dual;

It will output -356. When we pass a negative value then it returns an integer less than the value passed.
Which function is used to know the database name by giving the database ID?

The DB_NAME function is used to know the database name. It takes the database id as the argument.
DB_NAME(dbID)


Example:- SELECT DB_NAME(5) -->Student
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