MS SQL Server 2005 Interview Questions and Answers

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

MS Sql Server 2005 Interview Questions and Answers

 
1.What does integration of .NET Framework mean for SQL Server 2005?
This feature enables us to execute C# or VB.NET code in the DBMS to take advantage of the .NET
functionality. This feature gives more flexibility in writing complex stored procedures, functions,
and triggers that can be written in .net compatible language.

2.What is SSIS?
According to Microsoft SQL Server Integration Services, “(SSIS) is an effective set of tools for both
the traditional demands of ETL operations, as well as for the evolving needs of general purpose
data integration.” In short, it is the next version of DTS (Data Transformation Services). ETL
stands for Extract, Transform and Loading. In short it is a data migration tool that is flexible,
fast, and has scalable architecture that enables effective data integration in current business
environments.

3.What is MARS?
In previous versions of SQL Server, applications had to process or cancel all result sets from one
batch before it could execute any other batch on that connection. SQL Server 2005 introduces a
new connection attribute that allows applications to have more than one pending request per
connection, and in particular, to have more than one active default result set per connection.
Multiple Active Result Sets (MARS) is the ability to have more than one pending request under a
given SQL Server connection. MARS is a programming model enhancement that allows multiple
requests to interleave in the server. We need to note that it is not a parallel execution in the
server. However, it may benefit us with some performance benefits if used correctly. By default,
this feature is not set in SQL Server 2005.

4.What are the Security Enhancements in SQL Server 2005?


SQL Server 2005 enables administrators to manage permissions at a granular level.

· In the new SQL Server 2005, we can specify a context under which statements in a module can
execute.
· SQL Server 2005 clustering supports Kerberos authentication against a SQL Server 2005 virtual
server.
· Administrators can specify Microsoft Windows-style policies on standard logins so that a
consistent policy is applied across all accounts in the domain.
· SQL Server 2005 supports encryption capabilities within the database itself, fully integrated
with a key management infrastructure. By default, client-server communications are encrypted.
5.What is new with the Reporting services in SQL server 2005?
SQL Server 2005 Reporting Services is a key component of SQL Server 2005 that provides
customers with an enterprise-capable reporting platform. This comprehensive environment is
used for authoring, managing, and delivering reports to the entire organization. SQL Server 2005
reporting services have some major changes when compared with the previous version.
· Changes to the core functionality of the Reporting services in the design of the report,
processing, and interactivity
· Better Integration with other components – Enhanced integration with other components within
SQL Server 2005 like SSIS, SSAS and SQL Server Management studio
· Report Builder – A new reporting tool that enables business users to create their own reports

6.What is OLAP?
Online Analytical Processing (OLAP) allows us to access aggregated and organized data from
business data sources, such as data warehouses, in a multidimensional structure called a cube.
The arrangement of data into cubes avoids a limitation of relational databases which are not well
suited for near instantaneous analysis of large amounts of data. OLAP cubes can be thought of as
extensions to the two-dimensional array of a spreadsheet.

7.What is Data Mining?


According to MSDN Data, mining is “the process of extracting valid, authentic, and actionable
information from large databases.” Microsoft data mining tools are different from traditional data
mining applications in significant ways. Data Mining is a platform for developing intelligent
applications, not a stand-alone application. You can build custom applications that are intelligent
because the data mining models are easily accessible to the outside world. Further, the model is
extensible so that third parties can add custom algorithms to support particular mining needs.

8.What is new with the Analysis Services (SSAS) in SQL Server 2005?
SQL Server 2005 Analysis Services (SSAS) delivers online analytical processing (OLAP) and data
mining functionality through a combination of server and client technologies, further reinforced
through the use of a specialized development and management environment coupled with a
well-defined object model for designing, creating, deploying, and maintaining business
intelligence applications. The server component of Analysis Services is implemented as a
Microsoft Windows service. Clients communicate with Analysis Services using the public standard
XML for Analysis (XMLA), a SOAP-based protocol. Let us see the enhancements of made to SSAS.
· Supports up to 16 instances of Analysis Services Service.
· As discussed above, the Analysis Services service fully implements the XML for Analysis (XMLA)
1.1 specification. All communication with an instance of Analysis Services is handled through
XMLA commands in SOAP messages.
· Uses the Proactive caching.

9.What is Information Schema in SQL Sever 2005?


Information Schema is the part of the SQL- 92 standard which exposes the metadata of the
database. In SQL server, a set of views are created in each of the databases which exposes the
metadata of the database. The information schema is kept in a separate schema – information
schema – which exists in all databases, but which is not included in the search path by default.
For more information regarding Information schema please read this article.

10. What is Full Text Search? How does it get implemented in SQL server 2005?
Full-text search allows fast and flexible indexing for keyword-based query of text data stored in
a Microsoft SQL Server database. In contrast to the LIKE predicate which only works on character
patterns, full-text queries perform linguistic searches against this data, by operating on words
and phrases based on rules of a particular language.

11. What is integration of Microsoft Office System mean?


The integration with Microsoft Office system means the following.
· Table Analysis Tools for Excel: Provides an easy-to-use add-in that leverages SQL Server 2005
Data Mining behind the scenes to perform powerful end user analysis on spreadsheet data.
· Data Mining Client for Excel: Offers a full data mining model development lifecycle directly
within Excel 2007.
· Data Mining Templates for Visio: Enables powerful rendering and sharing of mining models as
annotatable Visio 2007 drawings.

12. What is the support of Web Services in SQL Server 2005?


With this feature the database engine can be directly exposed as a web service without a middle
tier or even an IIS. This will enable the user to directly call a stored procedure by calling a web
method. This feature is designed with well-known standards such as SOAP 1.2, WSDL 1.1, and
HTTP. With this new feature we can now connect to SQL Server not only with TDS- Tabular data
stream (a binary protocol for connecting to SQL Server 2005) but also over SOAP/ HTTP.

13. What is OLTP?


Online Transaction Processing (OLTP) relational databases are optimal for managing changing
data. When several users are performing transactions at the same time, OLTP databases are
designed to let transactional applications write only the data needed to handle a single
transaction as quickly as possible.
14. What is Snapshot in SQL Server 2005?
A database snapshot is a read-only, static view of a database, the source database. Each
database snapshot is transaction-consistent with the source database as it existed at the time of
the snapshot’s creation.

15. What is snapshot isolation in SQL Server 2005?


SQL Server 2005 introduces a new “snapshot” isolation level that is intended to enhance
concurrency for online transaction processing (OLTP) applications. In prior versions of SQL
Server, concurrency was based solely on locking, which can cause blocking and deadlocking
problems for some applications. Snapshot isolation depends on enhancements to row versioning
and is intended to improve performance by avoiding reader-writer blocking scenarios.

16. What is Database Partitioning in SQL Server 2005?


SQL Server 2005 provides a new capability for the partitioning of tables across file groups in a
database. Partitioning a database improves performance and simplifies maintenance. By splitting
a large table into smaller, individual tables, queries accessing only a fraction of the data can run
faster because there is less data to scan.

17. What is SQL Server Agent?


SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks
called jobs. SQL Server Agent uses SQL Server to store job information. Jobs contain one or more
job steps. We generally schedule the backups on the production databases using the SQL server
agent. In SQL Server 2005 we have roles created for using SQL Server agents.
· SQLAgentUserRole
· SQLAgentReaderRole
· SQLAgentOperatorRole
SQL Server Agent for SQL Server 2005 provides a more robust security design than earlier
versions of SQL Server. This improved design gives system administrators the flexibility they
need to manage their Agent service.

18. What is Replication? What is the need to have the replication? What are the enhancements
made to SQL Server 2005 related to the replication?
“Replication is a set of technologies for copying and distributing data and database objects from
one database to another and then synchronizing between databases to maintain consistency.” In
short, replication is all about having multiple copies of the same database. We need replication
when we need to distribute data to and from different locations. Generally we have a master copy
of data. There will be multiple slaves (Clients) located at various locations which need to be
replicated. We use replication for a variety of reasons. Load balancing is sharing the data among
a number of servers and distributing the query load. Offline processing is one of the main
reasons. In this scenario we need to modify the data on the database that is not connected to the
network. The last reason may be to have a back-up to the database in case of failure to the
existing database. Let us see the enhancements of SQL server 2005 database related to
replication.
· Database Mirroring – Database Mirroring is moving the transactions of database from one SQL
Server database to another SQL server database on a different SQL Server.
· Replication Management topology (RMO) – RMO is a new construct in SQL Server 2005. It is a
.NET Framework library that provides a set of common language runtime classes for configuring,
managing, and scripting replication, and for synchronizing Subscribers.

19. What are Business Logic Handlers?


Business logic handlers are written in managed code and allow us to execute custom business
logic during the merge synchronization. We can invoke the business logic handler in case of
non-conflicting data changes. Business logic handler can perform one of the following three
actions.

· Reject Data
· Accept Data
· Apply Custom Data

20. What are different variants of SQL Server 2005?


There are different variants of SQL Server 2005 commercially available.
· Express – Free and only for one user
· Enterprise – 5 users apart from server
· Workgroup – 10 users apart from server
· Standard – 25 users apart from server

21. What are Various Service packs available for SQL Server 2005?
As of now there are two service packs available for the SQL Server 2005.
· Service Pack 1 – Has major changes or enhancements to SQL Server 2005 in Analysis Services,
Data Programmability, SSIS, and reporting services.
· Service Pack 2 – Unlike Service Pack 2, this service pack enables SQL Server 2005 customers to
take advantage of the enhancements within Windows Vista and the 2007 Office system.

22. What are the New Data types introduced in SQL Server 2005?
SQL Server 2005 has added some new data types to its existing data types.
XML Data type
· VARCHAR (MAX)
· NVARCHAR (MAX)
· VARBINARY (MAX)
As we can see, the new term MAX has been introduced in SQL Server 2005. This new specifier
expands the storage capabilities of the varchar, nvarchar, and varbinary data types.
Varchar(max), nvarchar(max), and varbinary(max) are collectively called large-value data types.

23. Does SQL Server 2005 support SMTP?


SQL Server 2005 now supports sending E-mail from the database. It is called as database mail
and it uses DatabaseMail90.exe. Gone are the days when we were using a third party component
for this. Receiving an e-mail was not supported in the previous versions of SQL Server.

24. What is SQL Management Object is SQL Server 2005?


These are collection of objects that are made for programming all aspects of managing Microsoft
SQL Server 2005. SMO is a .NET based object model. It comes with SQL Server 2005 as a .Net
assembly named Microsoft.SqlServer.Smo.dll. We can use these objects for connecting to a
database, calling methods of the database that returns a table, using transactions, transferring
data, scheduling administrative tasks, etc. The best part about SMO is that most of it can also be
used with SQL server 2000.

25. What is SQL Service Broker in SQL Server 2005?


SQL Service broker is a new technology introduced in SQL Server 2005 for building database-
intensive distributed applications. Basically, service broker has been built for developing
applications that consist of individual components which are loosely coupled. Service broker
supports asynchronous yet reliable messages that are passed between the components. These
messages are called conversations.

Top 10 SQL Server DBA Interview Questions


By Deanna Dicken

Deanna Dicken shares the top 10 interview questions she finds useful for SQL Server DBAs.

Introduction

Last month I wrote an article on the questions I find most useful for interviewing a SQL
Server developer. In this article, I'll cover the top 10 interview questions for SQL Server
DBAs.
What purpose does the model database serve?

The model database, as its name implies, serves as the model (or template) for all databases
created on the same instance. If the model database is modified, all subsequent databases
created on that instance will pick up those changes, but earlier created databases will not.
Note that TEMPDB is also created from model every time SQL Server starts up.

How do you trace the traffic hitting a SQL Server?

SQL profiler is the SQL Server utility you can use to trace the traffic on the SQL Server
instance. Traces can be filtered to narrow down the transactions that are captured and
reducing the overhead incurred for the trace. The trace files can be searched, saved off, and
even replayed to facilitate troubleshooting.

What types of replication are supported in SQL Server?

SQL Server has three types of replication: Snapshot, Merge, and Transaction. Snapshot
replication creates a snapshot of the data (point-in-time picture of the data) to deliver to the
subscribers. This is a good type to use when the data changes infrequently, there is a small
amount of data to replicate, or large changes occur over a small period of time.

Merge replication uses a snapshot to seed the replication. Changes on both sides of the
publication are tracked so the subscriber can synchronize with the publisher when connected.
A typical use for this type of replication is in a client and server scenario. A server would act
as a central repository and multiple clients would independently update their copies of the
data until connected. At which time, they would all send up their modifications to the central
store.

Transaction replication also begins with a snapshot only this time changes are tracked as
transactions (as the name implies). Changes are replicated from publisher to subscriber the
same as they occurred on the publisher, in the same order as they occurred, and in near real
time. This type of replication is useful when the subscriber needs to know every change that
occurred to the data (not point-in-time), when the change volume is high, and when the
subscriber needs near real-time access to the changes.

Why would you use SQL Agent?

SQL Agent is the job scheduling mechanism in SQL Server. Jobs can be scheduled to run at a
set time or when a specific event occurs. Jobs can also be executed on demand. SQL Agent is
most often used to schedule administrative jobs such as backups.

What happens on checkpoint?

Checkpoints, whether scheduled or manually executed, cause the transaction log to be


truncated up to the beginning of the oldest open transaction (the active portion of the log).
That is, the dirty pages from the buffer cache are written to disk. Storing committed
transactions in the cache provides a performance gain for SQL Server. However, you do not
want the transaction log to get too big because it might consume too many resources and,
should your database fail, take too long to process to recover the database.
One important thing to note here is that SQL Server can only truncate up to the oldest open
transaction. Therefore, if you are not seeing the expected relief from a checkpoint, it could
very well be that someone forgot to commit or rollback their transaction. It is very important
to finalize all transactions as soon as possible.

What is DBCC?

DBCC statements are Database Console Commands and come in four flavors: Maintenance,
Informational, Validation, and Miscellaneous. Maintenance commands are those commands
that allow the DBA to perform maintenance activities on the database such as shrinking a file.
Informational commands provide feedback regarding the database such as providing
information about the procedure cache. Validation commands include commands that validate
the database such as the ever-popular CHECKDB. Finally, miscellaneous commands are those
that obviously don't fit in the other three categories. This includes statements like DBCC
HELP, which provides the syntax for a given DBCC command.

How can you control the amount of free space in your index
pages?

You can set the fill factor on your indexes. This tells SQL Server how much free space to
leave in the index pages when re-indexing. The performance benefit here is fewer page splits
(where SQL Server has to copy rows from one index page to another to make room for an
inserted row) because there is room for growth built in to the index.

Why would you call Update Statistics?

Update Statistics is used to force a recalculation of query optimization statistics for a table or
indexed view. Query optimization statistics are automatically recomputed, but in some cases,
a query may benefit from updating those statistics more frequently. Beware though that re-
computing the query statistics causes queries to be recompiled. This may or may not negate
all performance gains you might have achieved by calling update statistics. In fact, it could
have a negative impact on performance depending on the characteristics of the system.

What is a correlated sub-query?

A correlated sub-query is a nested query that is linked to the outer query. For instance, say I
wanted to find all the employees who have not entered their time for the week. I could query
the Employee table to get their first and last name, but I need to look at the TimeEntry table
to see if they've entered their time or not. I can't do a straight join here because I'm looking
for the absence of time data, so I'll do a correlated sub-query similar to this:

SELECT FirstName, LastName

FROM EMPLOYEE e

WHERE NOT EXISTS (SELECT 1 FROM TimeEntry te

WHERE te.EmpID = e.EmpID


AND te.WeekID = 35)

Notice that the inner query relates to the outer query on the employee ID, thus making it a
correlated sub-query. The inner query will be evaluated once per outer query row.

What authentication modes does SQL Server support?

SQL Server supports Windows Authentication and mixed-mode. Mixed-mode allows you to
use both Windows Authentication and SQL Server Authentication to log into your SQL Server.
It’s important to note that if you use Windows Authentication, you will not be able to log in as
sa.

Conclusion

In this article, I list the top 10 DBA interview question (as I see it anyway). I would, however,
encourage you to also ask the DBA the SQL Server Developer questions from my previous article.
As I said in that article though, every workplace and project has different needs. I hope you found
at least a few that you can use in yours.

SQL Server DBA

SQL Server DBA interview questions and answers


What are the steps to take to improve performance of a poor performing query?

Maximum use of indexes, stored procures should be done, Avoid excessive use of complicated joins and
cursors...........
Read answer

What is a deadlock and what is a live lock? How will you go about resolving deadlocks?

A deadlock occurs when two or more processes waits for a resource that is acquired by or is under the control of
another process. A live lock is similar to a deadlock except the process states keeps changing.............
Read answer

What is blocking and how would you troubleshoot it?

Blocking occurs when two or more rows are locked by one SQL connection and a second connection to the SQL server
requires a conflicting on lock on those rows. This results in the second connection to wait until the first lock is
released............
Read answer

Explain the different types of BACKUPs available in SQL Server.

Complete database backup: This type of backup will backup all the information in the database. Used most
commonly for disaster recovery and takes the longest time to backup.............
Read answer

What is database isolation in SQL Server?

Isolation in database defines how and when changes made by one transaction can be visible to other transactions.
Different isolation levels are:...............
Read answer

What is a Schema in SQL Server 2005? Explain how to create a new Schema in a a Database?

A schema is used to create database objects. It can be created using CREATE SCHEMA statement. The objects
created can be moved between schemas. Multiple database users can share a single default schema................
Read answer

Explain how to create a Scrollable Cursor with the SCROLL Option.

Using the SCROLL keyword while declaring a cursor allows fetching of rows in any sequence...............
Read answer

Explain how to create a Dynamic Cursor with the DYNAMIC Option.

When a cursor is declared as DYNAMIC, the cursor reflects all changes made to the base tables as the cursor is
scrolled around............... 
Read answer

SQL Server Database Architecture

Describe in brief Databases and SQL Server Databases Architecture, What are database files and
filegroups?................ 
Read answer

SQL Server system database

Master Database MSDB Database, TEMPDB Database, Model Database......... 


Read answer

SQL Server Transactions Architecture

What operations do SQL Server transaction logs support?


Explain the purpose of check points in a transaction log.
What is write-ahead transaction log?.............
Read answer

What is use of DBCC Commands?

Database Consistency Checker Commands give details in form of statistics about the SQL Server. They can be used
for Maintenance of database, index, or filegroup.............. 
Read answer
well thats a big requirement.
Depending on the level of proficiency ur employer is seeking, they can ask u different types of questions.
However, you must be very good at 
1. backup recovery (syntax and scenario based)
2. High availability (log shipping, replication, mirroring, clustering)
3. Security(authentication modes, impersonating)
4. Architecture bases theoretical questions
5. transaction log based questions (u need to know how transaction log works)
6. tempdb (its purpose)
7. Installation (troubleshooting)
8. various editions
9. upgrade(troubleshooting/precautions)
10. Migration (login/job scripting/precautions)
...

You might also like