Tuesday , June 19 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

Find all rows count and columns count in single database in sql server

In General for any database it contains lot of tables, if we want to find …

%d bloggers like this: