In this article, we will show you how to write a SQL Query to Swap Column Values in SQL Server with example. For this SQL Interview Question, We are going to use the below-shown data
How to Swap Column Values in SQL Server?
Please use the below-shown frequent query to swap two column values
-- Query to Swap Two Column Values in SQL Server USE [SQL Tutorial] GO UPDATE [dbo].[EmployeeDuplicates] SET [Education] = [Occupation], [Occupation] = [Education] GO
Let me show you the updated SQL Server records. From the below screenshot, you can see that the information in the Education column stored in Occupation Column. And data inside the Occupation column is stored in the Education column.