MS SQL Server 2005 Interview Questions and Answers
MS SQL Server 2005 Interview Questions and Answers
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.
· 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.
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.
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.
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.
· Reject Data
· Accept Data
· Apply Custom Data
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.
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.
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.
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.
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 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.
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.
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:
FROM EMPLOYEE e
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.
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.
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
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
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
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
Using the SCROLL keyword while declaring a cursor allows fetching of rows in any sequence...............
Read answer
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
Describe in brief Databases and SQL Server Databases Architecture, What are database files and
filegroups?................
Read answer
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)
...