0% found this document useful (0 votes)
4 views4 pages

IIF Function in SQL Server Tutorial

The document provides a video tutorial on the IIF function in SQL Server, which was introduced in SQL Server 2012 and serves as a shorthand for CASE expressions. It includes syntax examples and demonstrates how to use the IIF function to return values based on a Boolean expression. Additionally, it offers related video tutorials and resources for learning C#, .NET, and SQL Server.

Uploaded by

realayoola007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

IIF Function in SQL Server Tutorial

The document provides a video tutorial on the IIF function in SQL Server, which was introduced in SQL Server 2012 and serves as a shorthand for CASE expressions. It includes syntax examples and demonstrates how to use the IIF function to return values based on a Boolean expression. Additionally, it offers related video tutorials and resources for learning C#, .NET, and SQL Server.

Uploaded by

realayoola007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3/12/2023 Sql server, .

net and c# video tutorial: IIF function in SQL Server


The Wayback Machine - [Link]

Sql server, .net and c# video tutorial


Free C#, .Net and Sql server video tutorial for beginners and intermediate programmers.

Support us .Net Basics C# SQL [Link] Aarvi MVC Slides C# Programs Subscribe Download

IIF function in SQL Server

Suggested Videos
Part 119 - UNPIVOT in SQL Server
Part 120 - Reverse PIVOT table in SQL Server
Part 121 - Choose function in SQL Server

Pragim Technologies - Best software


training and placements in marathahalli,
bangalore. For further details please call
09945699393.

Complete Tutorials
How to become a full stack web
developer

Cloud computing complete tutorial

In this video we will discuss IIF function in SQL Server. Healthy food for healthy mind and
body

JavaScript tutorial

Bootstrap tutorial

Angular tutorial for beginners

Angular 5 Tutorial for beginners

[Link] 1/4
3/12/2023 Sql server, .net and c# video tutorial: IIF function in SQL Server

Important Videos
The Gift of Education

Web application for your business

How to become .NET developer

Resources available to help you

Dot Net Video Tutorials


Blazor tutorial

C tutorial

[Link] Core Tutorial


IIF function
Introduced in SQL Server 2012 [Link] Core Razor Pages Tutorial

Returns one of two the values, depending on whether the Boolean


Angular 6 Tutorial
expression evaluates to true or false
IIF is a shorthand way for writing a CASE expression Angular CRUD Tutorial
Syntax : IIF ( boolean_expression, true_value, false_value )
Angular CLI Tutorial

Example : Returns Male as the boolean expression evaluates to TRUE Angular 2 Tutorial

DECLARE @Gender INT Design Patterns


SET @Gender = 1
SOLID Principles
SELECT IIF( @Gender = 1, 'Male', 'Femlae') AS Gender
[Link] Web API
Output :
Bootstrap

AngularJS Tutorial

Example : Using IIF() function with table data. We will use the following Employees jQuery Tutorial
table for this example.
JavaScript with [Link] Tutorial

JavaScript Tutorial

Charts Tutorial

LINQ

LINQ to SQL

LINQ to XML

SQL Script to create Employees table Entity Framework


Create table Employees
WCF
(
Id int primary key identity,
[Link] Web Services
Name nvarchar(10),
GenderId int Dot Net Basics
)
Go C#

Insert into Employees values ('Mark', 1) SQL Server


Insert into Employees values ('John', 1)
[Link]
Insert into Employees values ('Amy', 2)
Insert into Employees values ('Ben', 1)
[Link]
Insert into Employees values ('Sara', 2)
Insert into Employees values ('David', 1) GridView
Go
[Link] MVC
Write a query to display Gender along with employee Name and GenderId. We can
Visual Studio Tips and Tricks
achieve this either by using CASE or IIF.
Dot Net Interview Questions

Slides
[Link] 2/4
3/12/2023 Sql server, .net and c# video tutorial: IIF function in SQL Server

Entity Framework

WCF

[Link] Web Services

Dot Net Basics

C#

SQL Server
Using CASE statement
[Link]
SELECT Name, GenderId,
CASE WHEN GenderId = 1 [Link]
THEN 'Male'
ELSE 'Female' GridView
END AS Gender
FROM Employees [Link] MVC

Visual Studio Tips and Tricks


Using IIF function
SELECT Name, GenderId, IIF(GenderId = 1, 'Male', 'Female') AS Gender
Java Video Tutorials
FROM Employees
Part 1 : Video | Text | Slides

Part 2 : Video | Text | Slides

Part 3 : Video | Text | Slides

Interview Questions
C#

SQL Server

Written Test

8 comments:

Anonymous October 15, 2015 at 3:20 AM


Hi Venkat sir,

Can you upload videos on SQL Jobs?

Thank you!
Reply

Unknown October 15, 2015 at 3:47 AM


What are difference between Truncate and Delete and Drop in SQL Server ?
Reply

Replies

Anonymous January 19, 2016 at 4:06 AM


1:Truncate is DDL Command where as Delete is DMl Commant.
2:Delete command can be delete all or selected data from a table with where
condition where as Truncate delete the all data from a table and we can use
filter criteria in truncate.
3: Truncate is much faster than delete command
4:Trunacte command reset the identity column where as delete command
cant be reset the identity column.

Anonymous January 19, 2016 at 4:08 AM

[Link] 3/4
3/12/2023 Sql server, .net and c# video tutorial: IIF function in SQL Server
1:Drop is DDL Command
2:Drop is used fro drop the table

Anonymous March 31, 2018 at 4:03 AM


THE main difference in between Truncate and Delete is:
in case of delete we can use rollback stateent the data
but in case of truncate it's not possible to use rollback the data.

Reply

Anonymous October 10, 2016 at 4:49 AM


Truncate:Delete all Rows from Table

Truncate table tablename

Delete:Delete Row BY Row From Table Or You Can Also Delete All Row From Table
Delete from tblename
delete from tablename where id=1

Drop:Delete Table Schema Means Delete


drop table table name
Reply

Aye July 4, 2019 at 8:31 PM


Venkat; You are a real gift from God, the Mighty. I have never seen a real generous
knowledge source like you. Thank you stay blessed.
Reply

Unknown May 22, 2020 at 6:28 AM


Can you please create a video using IFF or IF in UPDATE query?
It will be a big help.
Thank you
Reply

Enter your comment...

Comment as: Google Accoun

Publish Preview

It would be great if you can help share these free resources

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Powered by Blogger.

[Link] 4/4

You might also like