How To Get Table Count In SQL Server

How To Get Table Count In SQL Server

As a senior SQL developer, I often get the requirement to determine the number of tables in an SQL server database. I analyzed and identified a few approaches to help you achieve this task. I will walk you through all those approaches individually with examples and best practices in this article. Approach-1: Using sys.tables The … Read more

SQL Server Remove Duplicates From A Table

SQL Server Remove Duplicates From A Table

As a developer working in SQL Server, I often have to remove duplicate data from the tables to free up space in our database. In this article, I will discuss different approaches to this task. Approach-1: Using the ROW_NUMBER() Function We can use the ROW_NUMBER() Function for this purpose. Let us consider the example below, … Read more

How To Save Query Results As Table In SQL Server

How To Save Query Results As Table In SQL Server

Recently, my team was required to save the query results into a table on an SQL server. We identified a few simple approaches to do this. In this article, I will walk you through all those approaches individually. Approach-1: Using SELECT INTO Statement Syntax Example Let us consider a real-time example in which we copy … Read more

How to Alter Table Column to Allow NULL in SQL Server

How to Alter Table Column to Allow NULL in SQL Server

As an SQL developer, I was required to modify the existing table structure and alter a column to allow null values. In this article, I will walk you through multiple ways to alter table columns to allow NULL in SQL Server with real-world scenarios. Approach-1: Using the ALTER TABLE statement This is the primary and … Read more

How to Find Table Dependencies in SQL Server

How to Find Table Dependencies in SQL Server

Understanding table dependencies is crucial to maintaining database performance as a database administrator or developer working with SQL Server. It also helps if you are trying to fix any issue without breaking the existing functionality. As part of my daily activity, my first step is to check the dependencies before starting work with any issues. … Read more

How To View Table In SQL Server Management Studio

How To View Table In SQL Server Management Studio

It is so simple to view a table in SSMS. As a senior developer in SQL Server, I have identified several approaches. In this article, I will walk you through each approach. Approach-1: Using Object Explorer in SSMS Follow the below steps. 1. Log in to the SQL Server Management Studio (SSMS) 2. Expand the … Read more

How To Copy Table Schema In SQL Server

How To Copy Table Schema In SQL Server

As an SQL developer, I must constantly duplicate the table structure without copying the data. This is where copying the table schema comes into the picture. Since this process is part of my daily activity, I have identified a few approaches to copying the table schema in SQL Server. In this article, I will walk … Read more

How To Change Schema Of A Table In SQL Server

How To Change Schema Of A Table In SQL Server

My team recently received a requirement to change the schema of a table in the SQL server database. We have identified a few quick approaches to this task. In this article, I will walk you through each approach individually. Approach-1 Using ALTER SCHEMA Statement The primary approach is to use the ALTER SCHEMA Statement to … Read more

How To Create A Schema In SQL Server

How To Create A Schema In SQL Server

As an SQL developer, I was required to create a new schema for the SQL server. I have identified a few simple approaches to this. In this article, I will walk you through each approach individually. Approach 1: Using the CREATE SCHEMA Statement This is the basic approach to do this task. Syntax Example We … Read more

How to Get Table Row Count in SQL Server

How to Get Table Row Count in SQL Server

Since I used to get the requirement to determine the size of our data, it is crucial to know the row count in an SQL server table. As a senior developer in SQL, I have identified a few simple approaches to do this. In this article, I will walk you through all those approaches individually. … Read more