Thursday , October 18 2018
Home / DataBase / SQL SERVER / Special Functions

Special Functions

Special Functions:-

below are the Special Functions in sql server.
1.IsNUll():- Used to convert Nulls

if expr1 is Null returns expr2
if expr1 is NotNull returns expr1 only

Sal+comm as total sal from enp
1.select empno,ename,sal,comm,sal+comm as totalsal from enp.
In the above case if something sal+Null= Null
2.select empno,ename,sal,comn,sal+IsNull(comn,0) as totalsal from emp
In the above case if something+Null=something
[every employee nust have a salary comm is not must] If commission is Null show N/A (but not show Null)
select enpno,ename,sal,IsNull(cast(comm as varchar);’N/A’) as comm for emp.

2.Is date(Expr):-
user to check expression is Date(or)not

 

3.Is Numeric(expr):-
If check expression number returns one(1)
if expression not a number returns Zero(0)

See Also Sql server date function,sql server string functions,sql server mathematical functions

Print Friendly, PDF & Email

Give us your valuable feedback

comments

About Samba

Check Also

sql server backup script

Backup all databases in SQL Instance with one script

Backup: A copy of SQL Server data that can be used to restore and recover the …