How to Insert Identity Column in SQL Server

Insert Identity Column in SQL Server

In this SQL Server tutorial, I will show you how to insert identity column in SQL Server. Inserting the unique ID for each record in the table is not a good approach, so SQL Server provides an attribute called Identity column, which tells SQL Server to generate a unique value for each record automatically. In … Read more

While Loop in SQL Server Stored Procedure

While Loop in SQL Server Stored Procedure

In this SQL Server tutorial, I will explain the while loop in the SQL Server stored procedure. Whenever I am required to execute complex logic for many records in a table, I use the while loop to avoid writing this logic again and again; I encapsulate this logic into a stored procedure, so whenever I … Read more

SQL Server Find String in String

SQL Server Find String in String Using CHARINDEX

In this SQL Server tutorial, you will learn about SQL Server find string in a string. While analysing the data, I needed to find the specific existence of the strings within the data containing strings. Actually, I needed to find the specific pattern of strings, so for that, I used the CHARINDEX() function. Apart from … Read more

SQL Server Convert XML to String

Converting XML to String Using CAST() Function

In this Python tutorial, you will learn about SQL Server to convert XML to string. As you already know, you can’t use the XML data as a string if it is in the XML format. I mean, you can’t use it in your app. To use the XML data, you need to convert it into … Read more

SQL Server Check If Column Exists

SQL Server Check If Column Exists using COL_LENGTH

In this SQL Server tutorial, you will learn about SQL Server and check if the column Exists. As a database developer, you must know how to check if a column exists in the table, so I have explained several approaches to checking column existence here. Let’s start, SQL Server Check If Column Exists You can … Read more

How to Drop Table If Exists in SQL Server

Drop Table If Exists In SQL Server

In this SQL Server tutorial, I will show you how to drop a table if it exists in SQL Server. As a database developer, whenever the business logic changes, sometimes table objects become unnecessary, so removing these unnecessary objects is very important. In this tutorial, I have explained how to drop one of the objects, … Read more

SQL Server Drop Column with Constraint

SQL Server Drop Column with Constraint

In this SQL Server tutorial, I will explain the SQL Server drop column with constraint. Sometimes, you need to drop a column when it is no longer needed, but if any constraint depends on the column you want to drop, you may not be able to drop that column, and it will show an error … Read more

SQL Server Change Column to NOT NULL

SQL Server Change Column to Not Null

In this SQL Server tutorial, I will explain the SQL Server change column to NOT NULL. I created an e-commerce website that was running smoothly, but one day, I realized that the column stock could store null values. I needed to fix this issue because these columns must not contain null values. So, I used … Read more

How to Rename Column name in SQL Server

Choosing Rename Option to Rename Column name in SQL Server using SSMS

In this SQL Server tutorial, you will learn how to rename column name in SQL Server. Sometimes, a situation arises due to changes in the business logic where you will have to change the column’s name in the table. Considering that situation, I have explained two methods in this tutorial for renaming a column in … Read more