---
title: "Writer about If - Else statement in SQL Server?"  
description: "Writer about If - Else statement in SQL Server?"  
author: "Ashutosh Kumar Verma"  
published: 2021-11-15  
updated: 2021-11-15  
canonical: https://www.mindstick.com/forum/156834/writer-about-if-else-statement-in-sql-server  
category: "mssql server"  
tags: ["sql server", "sql"]  
reading_time: 1 minute  

---

# Writer about If - Else statement in SQL Server?

Writer about If - Else [statement in SQL](https://www.mindstick.com/forum/33706/what-is-the-difference-between-having-clause-and-group-by-statement-in-sql-server) [Server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over)?

## Replies

### Reply by Steilla Mitchel

**[SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) If-Else statement:**

If the condition is true then the ‘if’ statement will run. Otherwise the ‘if’ statement is of no use. if condition has no ‘else’ part with ‘If’ and when condition is true then ‘if’ statement will execute and if condition is not true then other statement out of ‘if’ condition will execute. If Else portion is provide with ‘if’ condition and when the condition is false then the else statement will execute.

Syntax- If without Else part,

```
If (condition)
// statement execute when condition is true.
```

If with Else part,

```
If (condition)
// statement when condition is true.
Else
// statement when condition is false.
```

\


---

Original Source: https://www.mindstick.com/forum/156834/writer-about-if-else-statement-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
