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?

Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for Android
Jakir Hossain
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
Akankshaji
 

Was ist angesagt? (18)

Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for Android
 
What is advanced SQL Injection? Infographic
What is advanced SQL Injection? InfographicWhat is advanced SQL Injection? Infographic
What is advanced SQL Injection? Infographic
 
Sql injections
Sql injectionsSql injections
Sql injections
 
JSP Technology I
JSP Technology IJSP Technology I
JSP Technology I
 
SQL Injection attack
SQL Injection attackSQL Injection attack
SQL Injection attack
 
Ebook3
Ebook3Ebook3
Ebook3
 
SQL Injections and Behind...
SQL Injections and Behind...SQL Injections and Behind...
SQL Injections and Behind...
 
Code injection
Code injectionCode injection
Code injection
 
jsp MySQL database connectivity
jsp MySQL database connectivityjsp MySQL database connectivity
jsp MySQL database connectivity
 
Microsoft Information Protection Implementation using C# and PowerShell
Microsoft Information Protection Implementation using C# and PowerShellMicrosoft Information Protection Implementation using C# and PowerShell
Microsoft Information Protection Implementation using C# and PowerShell
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
 
Sql injection
Sql injectionSql injection
Sql injection
 
Blind sql injection
Blind sql injectionBlind sql injection
Blind sql injection
 
Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16
 
JSP
JSPJSP
JSP
 
Types of sql injection attacks
Types of sql injection attacksTypes of sql injection attacks
Types of sql injection attacks
 
Web Security attacks and defense
Web Security attacks and defenseWeb Security attacks and defense
Web Security attacks and defense
 
A Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQLA Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQL
 

Ähnlich wie Ebook8

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 Ebook8 (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
 
Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9
 
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
 

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 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
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
 
Ebook4
Ebook4Ebook4
Ebook4
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Ebook8

  • 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