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

How To Change Column Name In SQL Server

How to change column name in SQL Server

Recently, I had the opportunity to work on an important table where I just needed to rename a few columns. Though it looks so simple, since it was a production environment, I was a little careful while doing this. The first thing I did was take a proper backup, and then I followed one of … Read more

Saving Changes Is Not Permitted SQL Server

Saving Changes Is Not Permitted SQL Server

Recently, I was working on an SQL server table and trying to add a new column per my client’s requirement using the SQL Server Management Studio Designer approach. In the designer view, I entered the column name and chose the data type, and when I clicked on the Save button, I got the saving changes … Read more

How To Add A Column To A Table In SQL Server

How to add a column to a table in SQL Server

Recently, my team was required to add a new column with critical data to an existing table. We used the ALTER TABLE Statement in the SQL server to add a column to the table. But before that, we ensured that we took the proper backup. Let us discuss this with a real-time example to give … Read more