SlideShare ist ein Scribd-Unternehmen logo
1 von 20
KAASHIV INFOTECH
The Asia, India, Tamil Nadu Book Of Record
Holders
SQL SERVER –Booklet 8
- Gives you the interview tips in SQL Server
SQL SERVER Interview Questions-2014
KAASHIV INFOTECH
Welcomes you to the Expert Voice Corner
Mr.J.Venkatesan Prabu
Venkatesan Prabu Jayakantham (venkat) has more than 8 years experience in the
Microsoft Technologies such as VB.Net, ASP.Net, C#.net, SSIS, SSAS, ADO.Net, etc.,
He is the Managing Director of KAASHIVINFOTECH
(http://www.kaashivinfotech.com/),a software company in Chennai. Before that, he
worked in HCL Technologies (India and Australia) for six years as Project Lead. As a
service motive, Venkat contributed more than 700 articles which is read by the
developers in 170 countries (400 developers per day)
(http://venkattechnicalblog.blogspot.com/). Aligned with KaaShiv InfoTech’s mission,he
met more than 20,000 young minds and spreaded Microsoft Technologies / Career
guidance programs. Venkat won many awards in his career, which includes Prestigious
Microsoft MVP (Most Valuable Professional) award for the years
2008,2009,2010,2011,2012,2013 and won many awards. List of other awards in his
career,
Microsoft certified Smart .Net Candidate in 2004
Most valuable member for dotnetspider site in 2007
HCL SQL Subject Matter expert (SME - SQL Server) for the year (2008,2009)
HCL Special contribution award winner on Dotnet skills for year(2008) HCL SQL
Knowledge Champion for the year 2009
Mind Cracker MVP on SQLServer –2010 for the year 2010,2011
INETA champion - Gold Member – 2010 for the year 2010 HCL Service
Contribution Award for the year 2010
Leading Lights "Rising Star" award from Common Wealth Bank, Australia for the
year 2010
TECHNICAL CERTIFICATION
Cisco certified Network Associate (CCNA) – 2004
 Microsoft Certified Application Developer (MCAD) – 2005
ACKNOWLEDGEMENT
I would like to thank my family members for their support and encouragement.
Without their support it would be impossible for me to publish this e-book. I would
also like to thank my KaaShiv InfoTech team for their support to publish this e-
book.
DISCLAIMER
All rights reserved. No part of this book may be copied, adapted, abridged or
stored in any retrieval system, computer system, photographic or other system or
transmitted in any form or by any means without the prior written permission of
the copyright holders. Any breach will entail legal action and permission without
further notice.
 
 
 
 
1. What is the difference between UNION and UNION ALL?
UNION The UNION command is used to select related information from two
tables, much like the JOIN command. However, when using the UNION
command all selected columns need to be of the same data type. With UNION,
only distinct values are selected.
UNION ALL The UNION ALL command is equal to the UNION command,
except that UNION ALL selects all values.
The difference between Union and Union all is that Union all will not eliminate
duplicate rows, instead it just pulls all rows from all tables fitting your query
specifics and combines them into a table.
2. What is B-Tree?
The database server uses a B-tree structure to organize index information. B-
Tree generally has following types of index pages or nodes:
root node: A root node contains node pointers to branch nodes which can be
only one.
branch node: A branch node contains pointers to leaf nodes or other branch
nodes which can be two or more.
leaf nodes: A leaf node contains index items and horizontal pointers to other
leaf nodes which can be many.
3. What is the difference between lock, block and deadlock?
 Lock: DB engine locks the rows/page/table to access the data which is worked
upon according to the query.
Block: When one process blocks the resources of another process then blocking
happens.
Blocking can be identified by using
SELECT * FROM sys.dm_exec_requests where blocked <> 0
SELECT * FROM master..sysprocesses where blocked <> 0
Deadlock: When something happens as follows: Error 1205 is reported by SQL
Server for deadlock.
4.What is the meaning of lock escalation and why/how to stop this?
When the DB engine would try to lock page first and then it escalates locks to
page and then table. If we understand that whole table would be locked for the
processing thenn this is better to use TABLOCK hint and get complete table
blocked. This is a nice way to avoid the wastage of sql server DB engine
processing for lock escalation. Somewhere you may also need to use
TABLOCKX when you want an exclusive lock on the table in the query.
5. How to truncate the log in sql server 2008?
BACKUP LOG TestDB WITH TRUNCATE_ONLY is gone. SQL server doesn’t
allow you to truncate the log now otherwise whole purpose of a DB is defeated.
6. What changes in the front end code is needed if mirroring is
implemented for the high availability?
You need to add only FAILOVER PARTNER information in your front end code.
“Data Source=ServerA;Failover Partner=ServerB;Initial
Catalog=AdventureWorks;Integrated Security=True;”.
7. Where does the copy job runs in the logshipping… Primary or
secondary?
Secondary server. This question is basically asked to find out whether you have
a handson work on logshipping or not. I came through many cases when
candidates have mentioned logshipping experience in many projects and they
can’t answer this question. I never selected any candidate if he/she don’t
answer these kind of small questions.
8. What are the ways to find what code is running for any spid?
Well there are many ways to do this.
1. find the spid which you want to analyze. An spid is assigned as soon as a
client connection is established with the SQL server. To find the spid you can
run any of the following command:
a) SP_WHO2 ‘ACTIVE’ — This will give you only active spids.
b) SELECT * FROM sys.dm_exec_requests  
2. Get the spid from above two queries and use any of the following query to get
what is happening behind that spid.
a) dbcc inputbuffer(<spid>)
b) sql2005 and sql2008 – SELECT * FROM sys.dm_exec_sql_text(<sqlhandle of
that spid>)
c) sql2005 and sql2008 – SELECT * FROM fn_get_sql(<sqlhandle of that spid>)
9. When you get following error? Error 3154: The backup set holds
a backup of a database other than the existing database.
The error comes when you are trying to restore the DB which already exists.
Use WITH REPLACE option to restore the DB with a different name.
10.  Does DBCC CHECKDB requires DB to be in SINGLE_USER
mode?
 Yes and No. This is tricky question. If you are using repair option with
CHECKDB then you have to have the DB in single user mode. Following is the
method to have your DB in a single user mode.
Use master
go
sp_dboption dbname, single, true
Following is the error which you get when you run the DBCC CHECKDB with
repair option wo having the DB in single user mode.
11. How to view the error log for any specific instance?
There are many ways but I prefer following method. Take a scenario when you
want to find the error log when the DB was put in a single user mode.
CREATE TABLE #Errorlog (Logdate Datetime, Processinfo VARCHAR(20),Text
VARCHAR(2000))
INSERT INTO #Errorlog
EXEC xp_readerrorlog
SELECT * FROM #Errorlog
WHERE Text Like ‘%SINGLE%USER%’
12. What does the NOLOCK query hint do?
Table hints allow you to override the default behavior of the query optimizer for
statements. They are specified in the FROM clause of the statement. While
overriding the query optimizer is not always suggested, it can be useful when
many users or processes are touching data.
The NOLOCK query hint is a good example because it allows you to read data
regardless of who else is working with the data; that is, it allows a dirty read of
data -- you read data no matter if other users are manipulating it. A hint like
NOLOCK increases concurrency with large data stores.
SELECT * FROM table_name (NOLOCK)
13.  What are the new features in SQL Server 2005 when compared
to SQL Server 2000?
There are quite a lot of changes and enhancements in SQL Server 2005. Few of
them are listed here :
Database Partitioning
Dynamic Management Views
System Catalog Views
Resource Database
Database Snapshots
SQL Server Integration Services
Support for Analysis Services on a a Failover Cluster.
Profiler being able to trace the MDX queries of the Analysis Server.
Peer-toPeer Replication
Database Mirroring
14. What are the High-Availability solutions in SQL Server
and differentiate them briefly.
Failover Clustering, Database Mirroring, Log Shipping and Replication are the
High-Availability features available in SQL Server.
15. How do you troubleshoot errors in a SQL Server Agent Job?
Inside SSMS, in Object explorer under SQL Server Agent look for Job Activity
Monitor. The job activity monitor displays the current status of all the jobs on the
instance. Choose the particular job which failed, right click and choose
view history from the drop down menu. The execution history of the job is
displayed and you may choose the execution time (if the job failed multiple times
during the same day). There would information such as the time it took to
execute that Job and details about the error occurred.
KaaShiv InfoTech Offers Best Inpant Training in Chennai.
 
The training at KAASHIV INFOTECH focus on developing the
technical oriented concepts that turn graduates into employable assets. Handled only by
professionals from MNC companies, we know how to equip you with strong technologies
fundamentals.
INPLANT TRAINING SCHEDULE FOR CSE/IT/MCA STUDENTS
Day Programme
 Day 1 BigData (Practical Demos)
Day 2
Windows 8 App Development (Practical
Demos)
Day 3
Ethical Hacking (Facebook
Hack,Server/Website Hacking(20
Attacks)
Day 4
Cloud Computing (Live Server
Demo,Live Pjt Implementation)
Day 5
CCNA (-Networking-Router
Configurations Practical Demo)
INPLANT TRAINING SCHEDULE FOR
ELECTRONIC/ELECTRICAL/EIE STUDENTS:
Day Programme
Day 1 Embedded System  (Embedded Program Designing ,Chip Burning)
Day 2
Wireless System  (Device Designing,Controlling Fans with Wireless
Sensors)
Day 3 CCNA  (-Networking-Router Configurations Practical Demo)
Day 4 Ethical Hacking  (Facebook Hack,Server/Website Hacking(20 Attacks)
Day 5 Matlab  (Capture Image,Processing, Animate Images-Practical Demos)
MECHANICAL/CIVIL INPLANT TRAINING SCHEDULE:
Day Programme
Day 1 Aircraft Designing
Day 2
Vehicle Movement in
Airports
Day 3 3D Packaging Designs
Day 4 3D Modeling
Day 5 3D Window Shading
Tags: inplanttraining in chennai,Best inplanttraining Program in Chennai
Anna Nagar,Best and Effective inplanttraining Program in Chennai at Anna
Nagar ,inplanttraining Program for Engineering Students , inplanttraining Program for Arts
and Science Students , inplanttraining Program for BE Students , inplanttraining Program
for Information Technology Students ,inplanttraining Program in Chennai , Best and
Effective inplanttraining Program in Chennai,Best and good inplanttraining Program in
Chennai,inplanttraining Program for Computer Science Students, inplanttraining Program
for Electronics and Communication Students,inplanttraining Program for Electrical and
Electronics Students , inplanttraining Program for Engineering Studentsin anna nagar ,
inplanttraining Program for Arts and Science Students in anna nagar,Effective
inplanttraining Program,Effective and Free inplanttraining Program,best inplanttraining in
chennai near rountana,best inplanttraining for engineering students in chennai,best
inplanttraining in anna nagar,inplanttraining for arts and science students in tamil nadu,best
inplanttraining for arts and science students in anna nagar near rountana,best
inplanttraining for ug graduates,best inplanttraining for pg graduates,best inplanttraining for
b.e/b.tech students,best inplanttraining for ug graduates in chennai,best inplanttraining for
ug graduates in anna nagar,best inplanttraining for ug graduates in tamil nadu,best
inplanttraining for pg graduates in chennai,
best inplanttraining for pg graduates in anna nagar,best inplanttraining for pg graduates in
tamil nadu,inplanttraining for cse students,inplanttraining for it students,inplanttraining for ece
students,inplanttraining for eee students,inplanttraining on android in chennai,inplanttraining
on java in chennai,inplanttraining on embedded systems in chennai,inplanttraining on matlab
in chennai,inplanttraining on .net in chennai,inplanttraining on android in anna
nagar,inplanttraining on java in anna nagar,inplanttraining on embedded systems in anna
nagar,inplanttraining on matlab in anna nagar,inplanttraining on .net in anna nagar,best
summer inplanttraining for arts and science ug graduates in chennai,best summer
inplanttraining for arts and science pg graduates in chennai,best summer inplanttraining for
engineering ug graduates in chennai,best summer inplanttraining for engineering pg
graduates in chennai,best summer inplanttraining for arts and science ug graduates in anna
nagar,best summer inplanttraining for arts and science pg graduates in anna nagar,best
summer inplanttraining for engineering ug graduates in anna nagar,best summer
inplanttraining for engineering pg graduates in anna nagar,best inplanttraining for mba
graduates in chennai,best inplanttraining fo mca graduates in chennai,best inplanttraining for
mba graduates in anna nagar,best inplanttraining for mca graduates in anna nagar,best
summer inplanttraining for mba graduates in chennai,best summer inplanttraining for mca
graduates in chennai,best summer inplanttraining for mba graduates in anna nagar, best
summer inplanttraining for mba graduates near rountana,best summer inplanttraining for mca
graduates near rountana
Address:
KAASHIV INFO TECH
Shivanantha Building,
X41, 5th Floor,2nd Avenue,
(Near Ayyappan Temple)
Anna Nagar, Chennai = 600040.
Send Us Your Request Email To arun@kaashivinfotech.com,
kaashiv.info@gmail.com,
venkat@kaashivinfotech.com
Contact Number : 9840678906 ;; 9003718877 ;; 9962345637 ;
Visit our other websites:
http://inplanttrainingchennai.com/ - Inplant Training Portal
http://inplanttrainingchennai.com/ - Internship Portal
jobsanddumps.com – Job Portal
https://plus.google.com/u/0/108546120202591604585
 
https://plus.google.com/u/0/b/110228862465265998202/dashboard/overvie
https://plus.google.com/u/0/b/117408505876070870512/dashboard/overvie
https://plus.google.com/u/0/b/104468163439231303834
/dashboard/overview
 
https://plus.google.com/u/0/b/117640664472494971423/dashboard/
overview
KaaShiv InfoTech Facebook Page
 
https://www.facebook.com/KaaShivInfoTech
 
Inplant Training Program in Chennai
 
https://www.facebook.com/pages/Inplant-Training-Program-in-
Chennai/1402097696706380
Internship in Chennai
https://www.facebook.com/pages/Internship-in-Chennai-
KaaShiv/1446147235603704
Inplant Training
https://www.facebook.com/pages/Inplant-Training/256116284550327
 

Weitere ähnliche Inhalte

Was ist angesagt?

Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv Owasp
Aung Khant
 

Was ist angesagt? (19)

Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Sql tutorial-Structured query language
Sql tutorial-Structured query languageSql tutorial-Structured query language
Sql tutorial-Structured query language
 
Advanced sql injection 2
Advanced sql injection 2Advanced sql injection 2
Advanced sql injection 2
 
Recipes 10 of Data Warehouse and Business Intelligence - The descriptions man...
Recipes 10 of Data Warehouse and Business Intelligence - The descriptions man...Recipes 10 of Data Warehouse and Business Intelligence - The descriptions man...
Recipes 10 of Data Warehouse and Business Intelligence - The descriptions man...
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
SQL injection exploitation internals
SQL injection exploitation internalsSQL injection exploitation internals
SQL injection exploitation internals
 
Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injection
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | EdurekaSQL Joins With Examples | Edureka
SQL Joins With Examples | Edureka
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv Owasp
 
Chapter6 database connectivity
Chapter6 database connectivityChapter6 database connectivity
Chapter6 database connectivity
 
treeview
treeviewtreeview
treeview
 
Pl sql-ch1
Pl sql-ch1Pl sql-ch1
Pl sql-ch1
 
Payilagam oracle sql & plsql training syllabus
Payilagam oracle sql & plsql training syllabusPayilagam oracle sql & plsql training syllabus
Payilagam oracle sql & plsql training syllabus
 
Schema webinar
Schema webinarSchema webinar
Schema webinar
 

Andere mochten auch

Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
vijaybusu
 

Andere mochten auch (10)

Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9
 
Oracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersOracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for Freshers
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
 
Sql queries questions and answers
Sql queries questions and answersSql queries questions and answers
Sql queries questions and answers
 
My Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cMy Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12c
 
Oracle Complete Interview Questions
Oracle Complete Interview QuestionsOracle Complete Interview Questions
Oracle Complete Interview Questions
 
Sql queires
Sql queiresSql queires
Sql queires
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 

Ähnlich wie Sql interview question part 8

Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9
kaashiv1
 
Sql interview question part 12
Sql interview question part 12Sql interview question part 12
Sql interview question part 12
kaashiv1
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
kaashiv1
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
kaashiv1
 

Ähnlich wie Sql interview question part 8 (20)

Ebook7
Ebook7Ebook7
Ebook7
 
Sql interview question part 7
Sql interview question part 7Sql interview question part 7
Sql interview question part 7
 
Ebook11
Ebook11Ebook11
Ebook11
 
Ebook9
Ebook9Ebook9
Ebook9
 
Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview question part 6
Sql interview question part 6Sql interview question part 6
Sql interview question part 6
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Sql interview question part 12
Sql interview question part 12Sql interview question part 12
Sql interview question part 12
 
Ebook12
Ebook12Ebook12
Ebook12
 
Sql interview question part 12
Sql interview question part 12Sql interview question part 12
Sql interview question part 12
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentation
 
Ebook5
Ebook5Ebook5
Ebook5
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
 
Ebook2
Ebook2Ebook2
Ebook2
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 

Mehr von kaashiv1 (9)

Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Sql interview question part 1
Sql interview question part 1Sql interview question part 1
Sql interview question part 1
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Sql interview question part 3
Sql interview question part 3Sql interview question part 3
Sql interview question part 3
 
Sql interview question part 1
Sql interview question part 1Sql interview question part 1
Sql interview question part 1
 
Ebook10
Ebook10Ebook10
Ebook10
 
Ebook8
Ebook8Ebook8
Ebook8
 
Ebook4
Ebook4Ebook4
Ebook4
 
Ebook3
Ebook3Ebook3
Ebook3
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Kürzlich hochgeladen (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Sql interview question part 8

  • 1. KAASHIV INFOTECH The Asia, India, Tamil Nadu Book Of Record Holders SQL SERVER –Booklet 8 - Gives you the interview tips in SQL Server SQL SERVER Interview Questions-2014
  • 2. KAASHIV INFOTECH Welcomes you to the Expert Voice Corner Mr.J.Venkatesan Prabu Venkatesan Prabu Jayakantham (venkat) has more than 8 years experience in the Microsoft Technologies such as VB.Net, ASP.Net, C#.net, SSIS, SSAS, ADO.Net, etc., He is the Managing Director of KAASHIVINFOTECH (http://www.kaashivinfotech.com/),a software company in Chennai. Before that, he worked in HCL Technologies (India and Australia) for six years as Project Lead. As a service motive, Venkat contributed more than 700 articles which is read by the developers in 170 countries (400 developers per day) (http://venkattechnicalblog.blogspot.com/). Aligned with KaaShiv InfoTech’s mission,he met more than 20,000 young minds and spreaded Microsoft Technologies / Career guidance programs. Venkat won many awards in his career, which includes Prestigious Microsoft MVP (Most Valuable Professional) award for the years 2008,2009,2010,2011,2012,2013 and won many awards. List of other awards in his career,
  • 3. Microsoft certified Smart .Net Candidate in 2004 Most valuable member for dotnetspider site in 2007 HCL SQL Subject Matter expert (SME - SQL Server) for the year (2008,2009) HCL Special contribution award winner on Dotnet skills for year(2008) HCL SQL Knowledge Champion for the year 2009 Mind Cracker MVP on SQLServer –2010 for the year 2010,2011 INETA champion - Gold Member – 2010 for the year 2010 HCL Service Contribution Award for the year 2010 Leading Lights "Rising Star" award from Common Wealth Bank, Australia for the year 2010 TECHNICAL CERTIFICATION Cisco certified Network Associate (CCNA) – 2004  Microsoft Certified Application Developer (MCAD) – 2005
  • 4. ACKNOWLEDGEMENT I would like to thank my family members for their support and encouragement. Without their support it would be impossible for me to publish this e-book. I would also like to thank my KaaShiv InfoTech team for their support to publish this e- book. DISCLAIMER All rights reserved. No part of this book may be copied, adapted, abridged or stored in any retrieval system, computer system, photographic or other system or transmitted in any form or by any means without the prior written permission of the copyright holders. Any breach will entail legal action and permission without further notice.        
  • 5. 1. What is the difference between UNION and UNION ALL? UNION The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type. With UNION, only distinct values are selected. UNION ALL The UNION ALL command is equal to the UNION command, except that UNION ALL selects all values. The difference between Union and Union all is that Union all will not eliminate duplicate rows, instead it just pulls all rows from all tables fitting your query specifics and combines them into a table. 2. What is B-Tree? The database server uses a B-tree structure to organize index information. B- Tree generally has following types of index pages or nodes: root node: A root node contains node pointers to branch nodes which can be only one. branch node: A branch node contains pointers to leaf nodes or other branch nodes which can be two or more.
  • 6. leaf nodes: A leaf node contains index items and horizontal pointers to other leaf nodes which can be many. 3. What is the difference between lock, block and deadlock?  Lock: DB engine locks the rows/page/table to access the data which is worked upon according to the query. Block: When one process blocks the resources of another process then blocking happens. Blocking can be identified by using SELECT * FROM sys.dm_exec_requests where blocked <> 0 SELECT * FROM master..sysprocesses where blocked <> 0 Deadlock: When something happens as follows: Error 1205 is reported by SQL Server for deadlock. 4.What is the meaning of lock escalation and why/how to stop this? When the DB engine would try to lock page first and then it escalates locks to page and then table. If we understand that whole table would be locked for the processing thenn this is better to use TABLOCK hint and get complete table blocked. This is a nice way to avoid the wastage of sql server DB engine processing for lock escalation. Somewhere you may also need to use TABLOCKX when you want an exclusive lock on the table in the query.
  • 7. 5. How to truncate the log in sql server 2008? BACKUP LOG TestDB WITH TRUNCATE_ONLY is gone. SQL server doesn’t allow you to truncate the log now otherwise whole purpose of a DB is defeated. 6. What changes in the front end code is needed if mirroring is implemented for the high availability? You need to add only FAILOVER PARTNER information in your front end code. “Data Source=ServerA;Failover Partner=ServerB;Initial Catalog=AdventureWorks;Integrated Security=True;”. 7. Where does the copy job runs in the logshipping… Primary or secondary? Secondary server. This question is basically asked to find out whether you have a handson work on logshipping or not. I came through many cases when candidates have mentioned logshipping experience in many projects and they can’t answer this question. I never selected any candidate if he/she don’t answer these kind of small questions.
  • 8. 8. What are the ways to find what code is running for any spid? Well there are many ways to do this. 1. find the spid which you want to analyze. An spid is assigned as soon as a client connection is established with the SQL server. To find the spid you can run any of the following command: a) SP_WHO2 ‘ACTIVE’ — This will give you only active spids. b) SELECT * FROM sys.dm_exec_requests   2. Get the spid from above two queries and use any of the following query to get what is happening behind that spid. a) dbcc inputbuffer(<spid>) b) sql2005 and sql2008 – SELECT * FROM sys.dm_exec_sql_text(<sqlhandle of that spid>) c) sql2005 and sql2008 – SELECT * FROM fn_get_sql(<sqlhandle of that spid>)
  • 9. 9. When you get following error? Error 3154: The backup set holds a backup of a database other than the existing database. The error comes when you are trying to restore the DB which already exists. Use WITH REPLACE option to restore the DB with a different name. 10.  Does DBCC CHECKDB requires DB to be in SINGLE_USER mode?  Yes and No. This is tricky question. If you are using repair option with CHECKDB then you have to have the DB in single user mode. Following is the method to have your DB in a single user mode. Use master go sp_dboption dbname, single, true Following is the error which you get when you run the DBCC CHECKDB with repair option wo having the DB in single user mode.
  • 10. 11. How to view the error log for any specific instance? There are many ways but I prefer following method. Take a scenario when you want to find the error log when the DB was put in a single user mode. CREATE TABLE #Errorlog (Logdate Datetime, Processinfo VARCHAR(20),Text VARCHAR(2000)) INSERT INTO #Errorlog EXEC xp_readerrorlog SELECT * FROM #Errorlog WHERE Text Like ‘%SINGLE%USER%’ 12. What does the NOLOCK query hint do? Table hints allow you to override the default behavior of the query optimizer for statements. They are specified in the FROM clause of the statement. While overriding the query optimizer is not always suggested, it can be useful when many users or processes are touching data.
  • 11. The NOLOCK query hint is a good example because it allows you to read data regardless of who else is working with the data; that is, it allows a dirty read of data -- you read data no matter if other users are manipulating it. A hint like NOLOCK increases concurrency with large data stores. SELECT * FROM table_name (NOLOCK) 13.  What are the new features in SQL Server 2005 when compared to SQL Server 2000? There are quite a lot of changes and enhancements in SQL Server 2005. Few of them are listed here : Database Partitioning Dynamic Management Views System Catalog Views Resource Database Database Snapshots SQL Server Integration Services Support for Analysis Services on a a Failover Cluster. Profiler being able to trace the MDX queries of the Analysis Server.
  • 12. Peer-toPeer Replication Database Mirroring 14. What are the High-Availability solutions in SQL Server and differentiate them briefly. Failover Clustering, Database Mirroring, Log Shipping and Replication are the High-Availability features available in SQL Server. 15. How do you troubleshoot errors in a SQL Server Agent Job? Inside SSMS, in Object explorer under SQL Server Agent look for Job Activity Monitor. The job activity monitor displays the current status of all the jobs on the instance. Choose the particular job which failed, right click and choose view history from the drop down menu. The execution history of the job is displayed and you may choose the execution time (if the job failed multiple times during the same day). There would information such as the time it took to execute that Job and details about the error occurred.
  • 13. KaaShiv InfoTech Offers Best Inpant Training in Chennai.   The training at KAASHIV INFOTECH focus on developing the technical oriented concepts that turn graduates into employable assets. Handled only by professionals from MNC companies, we know how to equip you with strong technologies fundamentals. INPLANT TRAINING SCHEDULE FOR CSE/IT/MCA STUDENTS Day Programme  Day 1 BigData (Practical Demos) Day 2 Windows 8 App Development (Practical Demos) Day 3 Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks) Day 4 Cloud Computing (Live Server Demo,Live Pjt Implementation) Day 5 CCNA (-Networking-Router Configurations Practical Demo)
  • 14. INPLANT TRAINING SCHEDULE FOR ELECTRONIC/ELECTRICAL/EIE STUDENTS: Day Programme Day 1 Embedded System  (Embedded Program Designing ,Chip Burning) Day 2 Wireless System  (Device Designing,Controlling Fans with Wireless Sensors) Day 3 CCNA  (-Networking-Router Configurations Practical Demo) Day 4 Ethical Hacking  (Facebook Hack,Server/Website Hacking(20 Attacks) Day 5 Matlab  (Capture Image,Processing, Animate Images-Practical Demos)
  • 15. MECHANICAL/CIVIL INPLANT TRAINING SCHEDULE: Day Programme Day 1 Aircraft Designing Day 2 Vehicle Movement in Airports Day 3 3D Packaging Designs Day 4 3D Modeling Day 5 3D Window Shading
  • 16. Tags: inplanttraining in chennai,Best inplanttraining Program in Chennai Anna Nagar,Best and Effective inplanttraining Program in Chennai at Anna Nagar ,inplanttraining Program for Engineering Students , inplanttraining Program for Arts and Science Students , inplanttraining Program for BE Students , inplanttraining Program for Information Technology Students ,inplanttraining Program in Chennai , Best and Effective inplanttraining Program in Chennai,Best and good inplanttraining Program in Chennai,inplanttraining Program for Computer Science Students, inplanttraining Program for Electronics and Communication Students,inplanttraining Program for Electrical and Electronics Students , inplanttraining Program for Engineering Studentsin anna nagar , inplanttraining Program for Arts and Science Students in anna nagar,Effective inplanttraining Program,Effective and Free inplanttraining Program,best inplanttraining in chennai near rountana,best inplanttraining for engineering students in chennai,best inplanttraining in anna nagar,inplanttraining for arts and science students in tamil nadu,best inplanttraining for arts and science students in anna nagar near rountana,best inplanttraining for ug graduates,best inplanttraining for pg graduates,best inplanttraining for b.e/b.tech students,best inplanttraining for ug graduates in chennai,best inplanttraining for ug graduates in anna nagar,best inplanttraining for ug graduates in tamil nadu,best inplanttraining for pg graduates in chennai,
  • 17. best inplanttraining for pg graduates in anna nagar,best inplanttraining for pg graduates in tamil nadu,inplanttraining for cse students,inplanttraining for it students,inplanttraining for ece students,inplanttraining for eee students,inplanttraining on android in chennai,inplanttraining on java in chennai,inplanttraining on embedded systems in chennai,inplanttraining on matlab in chennai,inplanttraining on .net in chennai,inplanttraining on android in anna nagar,inplanttraining on java in anna nagar,inplanttraining on embedded systems in anna nagar,inplanttraining on matlab in anna nagar,inplanttraining on .net in anna nagar,best summer inplanttraining for arts and science ug graduates in chennai,best summer inplanttraining for arts and science pg graduates in chennai,best summer inplanttraining for engineering ug graduates in chennai,best summer inplanttraining for engineering pg graduates in chennai,best summer inplanttraining for arts and science ug graduates in anna nagar,best summer inplanttraining for arts and science pg graduates in anna nagar,best summer inplanttraining for engineering ug graduates in anna nagar,best summer inplanttraining for engineering pg graduates in anna nagar,best inplanttraining for mba graduates in chennai,best inplanttraining fo mca graduates in chennai,best inplanttraining for mba graduates in anna nagar,best inplanttraining for mca graduates in anna nagar,best summer inplanttraining for mba graduates in chennai,best summer inplanttraining for mca graduates in chennai,best summer inplanttraining for mba graduates in anna nagar, best summer inplanttraining for mba graduates near rountana,best summer inplanttraining for mca graduates near rountana
  • 18. Address: KAASHIV INFO TECH Shivanantha Building, X41, 5th Floor,2nd Avenue, (Near Ayyappan Temple) Anna Nagar, Chennai = 600040. Send Us Your Request Email To arun@kaashivinfotech.com, kaashiv.info@gmail.com, venkat@kaashivinfotech.com Contact Number : 9840678906 ;; 9003718877 ;; 9962345637 ; Visit our other websites: http://inplanttrainingchennai.com/ - Inplant Training Portal http://inplanttrainingchennai.com/ - Internship Portal jobsanddumps.com – Job Portal https://plus.google.com/u/0/108546120202591604585   https://plus.google.com/u/0/b/110228862465265998202/dashboard/overvie https://plus.google.com/u/0/b/117408505876070870512/dashboard/overvie
  • 19. https://plus.google.com/u/0/b/104468163439231303834 /dashboard/overview   https://plus.google.com/u/0/b/117640664472494971423/dashboard/ overview KaaShiv InfoTech Facebook Page   https://www.facebook.com/KaaShivInfoTech   Inplant Training Program in Chennai   https://www.facebook.com/pages/Inplant-Training-Program-in- Chennai/1402097696706380 Internship in Chennai https://www.facebook.com/pages/Internship-in-Chennai- KaaShiv/1446147235603704