Author Archives: Ashish Jain

About Ashish Jain

I am Ashish Jain, a software engineer by profession. My goal of creating this blog is to share my knowledge of SQL server with all other SQL enthusiasts and also to learn from them.

How to identify unused indexes in SQL Server

We can use dynamic management view “sys.dm_db_index_usage_stats” to identify unused indexes on SQL Server. DMV – sys.dm_db_index_usage_stats This DMV shows you how many times the index was used for user queries. SELECT OBJECT_NAME(S.[OBJECT_ID]) AS [OBJECT NAME],        I.[NAME] AS [INDEX … Continue reading

Posted in Advanced SQL | Tagged , , | Leave a comment

How to Enable multiple SQL agent Jobs using single SQL Query

Here is the SQL query to Enable multiple SQL Agents Jobs. exec sp_configure ‘allow updates’,1 go reconfigure with override go update msdb.dbo.sysjobs set [enabled] = 1 where name like ‘Ownership Standardization%’ go exec sp_configure ‘allow updates’,0 go reconfigure with override … Continue reading

Posted in Advanced SQL | Tagged , , , | Leave a comment

How to Create Table and define data integrity

In this post I will show you how you can create table and define data integrity on the table’s data. To explain you with example I create a new database on my SQL Server instance with the name “sampleDB”. Here … Continue reading

Posted in T-SQL | Tagged , , , | Leave a comment

SQL Server Architecture

This section will introduce you to the SQL Server architecture, the entities involved—SQL Server instances, databases, schemas, and database objects. SQL Server Instances A SQL Server instance is an installation of a SQL Server database engine/service. You can install multiple … Continue reading

Posted in SQL Fundamentals | Leave a comment

SQL Core Concepts (The Data Life Cycle)

In SQL Server database data is actually similar to a product in an assembly line moving from one environment to another and undergoing transformations along the way. Figure-1 illustrates the data life cycle. OnLine Transactional Processing Data is entered initially … Continue reading

Posted in SQL Fundamentals | Leave a comment

Create Table in SQL

In this example i show you How you can create New table in a Database. For my example i use tempDB database.     –use tempDB database context use tempDB; –Drop Employee table if already exists in tempDB database If … Continue reading

Posted in T-SQL | Tagged | Leave a comment

Database Normalization and Normal Forms

Database Normalization: If you are doing database work from some time, you possibly have heard about Normalization before. Normalization is basically a process that is applied on databases to make sure of minimum redundancy (1. No duplicate data) and more … Continue reading

Posted in SQL Fundamentals | Tagged , , , , | Leave a comment