How To Check Table Description In SQL Server

How To Check Table Description In SQL Server

As a senior developer in SQL Server, I have identified a few best approaches to getting table descriptions. In this article, we will explore all the approaches. Approach-1 Using the sp_help stored procedure You can use the sp_help stored procedure to get the details of the SQL table mentioned in the query below. Syntax Example … Read more

How To Rename The Table Name In SQL Server

How To Rename The Table Name In SQL Server

Recently, a new MNC took over my current organization. My manager asked me to rename our database’s existing tables based on the latest company name. As a developer, I analyzed the requirements and identified the best approaches to changing the table names in the SQL server. Approach-1 Using the sp_rename Stored Procedure You can rename … Read more

How To Update Statistics On A Table In SQL Server

How To Update Statistics On A Table In SQL Server

As a senior developer working with SQL servers, when I was analyzed in terms of performance perspective, I learned that keeping the statistics up to date is crucial for optimal query performance. In this article, I will walk you through the best approaches to updating statistics on a table in an SQL server. Approach-1 Using … Read more

How to create index on temp table in SQL Server

How to create index on temp table in SQL Server

Performance is the primary key for one of our clients, so we are dealing with many temp tables. We then considered creating an index for those temp tables to significantly boost query performance. We have identified a few approaches to this. In this article, we will walk you through all those approaches to creating the … Read more

How To Enable CDC On A Table In SQL Server

How To Enable CDC On A Table In SQL Server

Recently, when I spoke to my client, they expected me to track and manage the data changes. So, as a DBA, I suggested to them why we can’t use the CDC feature of the SQL server, which we can enable at a database level and table level, etc. In this article, I will walk you … Read more

How To Create A Table Variable In SQL Server

How To Create A Table Variable In SQL Server

Last week, our client required us to work with tabular data. After analyzing this requirement, we identified a few ways to do this. I will discuss creating a table variable in an SQL server using practical examples and scenarios in this article. Table variables in SQL Server are like local variables that can hold tabular … Read more

How To Create A Table Valued Function In SQL Server

How To Create A Table Valued Function In SQL Server

As an SQL database developer, I found that table-valued functions in SQL Server help us manage and manipulate data. In this article, I’ll walk you through the process of creating table-valued functions, their benefits, and some real-world examples you can apply to your database applications. A table-valued function in SQL Server is a user-defined function … Read more

How to remove identity column in SQL Server

How to remove identity column in SQL Server

Recently, my team received a requirement to remove an identity column from one of our critical tables. Before trying to do it, we backed up the data for the identity column for the safer side. Then, we followed the simple approaches below to remove the column. Approach-1: Suggested approach You can not just blindly delete the … Read more

How to get table size in SQL Server

How to get table size in SQL Server

As a database administrator working with SQL Server, I’ve often needed to check the size of tables in my databases. Whether you’re managing the storage or optimizing the performance, knowing how to get table size in SQL Server is an essential skill. In this post, I’ll walk you through various approaches I have identified to … Read more

How To Check If Table Exists In SQL Server

How to check if table exists in SQL Server

Recently, we worked on a requirement to write an SQL script for automation purposes for our production environment. We had to check if the table existed, so we explored multiple approaches. Here, we will discuss the best approaches that we implemented. Approach-1 Using the OBJECT_ID() I have an existing table named “Product.” Let’s use the … Read more