-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Geek

Dharmendra is a SQL Server/Microsoft Data Platform professional with over eight years of experience. He enjoys helping others in the SQL Server community and does this by contributing on blogs, speaking at several SQL events. His passion and focus is to explore and share more and more on SQL Server.

Archives: April 2018

How to Perform Database Hack-Attach

This blog demonstrates attaching a database on the SQL Server Instance which already has the same name database up and running.

Scenario:

Suppose, you got a hardware migration activity. The migration activity involves moving the databases from old hardware to new hardware. Let’s say the server got only one big… Read more

3 comments, 785 reads

Posted in SQL Geek on 23 April 2018

Finding Untrusted Foreign Keys and Constraints

In the previous blog, we discussed the Foreign Keys Constraints and how the CHECK Constraints are useful to verify the data that goes into your tables. But, sometimes when you need to load a lot of data quickly, SQL Server allows you to temporarily disable any CHECK or FOREIGN KEY… Read more

2 comments, 1,920 reads

Posted in SQL Geek on 19 April 2018

Find Missing Indexes For All SQL Server Databases

DMV (Database Management View) and DMO (Database Management Objects) were added in 2005. There have been huge improvements in each new edition of SQL Server. It provides us a lot of useful information about SQL Server like – expensive queries, wait type, missing index…., and the list goes on and… Read more

1 comments, 437 reads

Posted in SQL Geek on 16 April 2018

SQL Server Logical Query Processing

Recently, while reviewing one of the stored procedure performance, I suggested a couple of changes to a developer to improve the performance of the SP. One of the suggestions was to replace DISTINCT with GROUP BY.

A few days later, he came back to me with a performance matrix to… Read more

0 comments, 907 reads

Posted in SQL Geek on 12 April 2018

How to Check SQL Server View Utilization

If you are working on SQL Server optimization delicately, you may get often queries that how to find if any index, table or view is being used in database or not.

In recent past, we went live for one of the critical application. The developers decided to check through all… Read more

0 comments, 718 reads

Posted in SQL Geek on 9 April 2018

What is a Foreign Key & How many foreign keys can you have on a single table?

Yesterday, I was attending a database design meeting. In the meeting, I was asked one of the questions – “How many foreign keys can you have on a single table?” Honestly, I had no clue about the limit. But, I must acknowledge that it was an excellent question… Read more

2 comments, 2,718 reads

Posted in SQL Geek on 5 April 2018

How SQL Compilation Can Prove the Server CPU

It is relatively easy to spot CPU-bound system. But, the source of CPU pressure is not always easy to pinpoint. The CPU can be driven by many factors on the server such as;

  • Memory pressure which is causing SQL Server to continually move data in and out of the memory.

Read more

4 comments, 223 reads

Posted in SQL Geek on 2 April 2018