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

Cannot create memory optimized tables. To create memory optimized tables, the database must have a MEMORY_OPTIMIZED_FILEGROUP that is online and has at least one container.

Cannot create memory optimized tables. To create memory optimized tables, the database must have a MEMORY_OPTIMIZED_FILEGROUP that is online and has at least one container.

Recently, I was working for a client, and I was supposed to create an in-memory table for the performance perspective. However, I got this error when I tried to create the in-memory table. You can see the same error in the screenshot below. Check out How To Create A Table Valued Function In SQL Server … 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

How To Insert Into Temp Table In SQL Server

How to insert into temp table in SQL Server

Recently, we worked on a requirement that required us to deal with temporary data storage. This is when we started inserting data into our temp table. During this journey, we identified a few simple and easy-to-use approaches. In this article, we will discuss all those approaches to inserting data into the temp table in the … Read more

How To Find Column Name In Table SQL Server

How to find column name in table SQL Server

It is easy to retrieve all the column names in a table. Let’s understand the whole process using a real-time example. I have an existing table named Vehicle. I want to know the column names available inside that table. There are two simple approaches to getting this. Approach-1 Using the sys.columns We can execute the … Read more

How To Check If Column Exists In SQL Server Database

How to check if column exists in SQL Server database

Recently, my team was tasked with implementing a new feature in one of our products that requires adding a new column to an existing table in our SQL database. As a research, we have identified a few best approaches to do this. In this article, we will discuss 3 simple approaches to checking whether a … Read more