How to use if condition in SQL Server?

How to use if condition in SQL Server?

You might come with a scenario where you need to use if condition when there are two possible cases occur. For example, when you develop a program or website, you want to do some sort of scheduling that can synchronize your current records with the existing data.