Strange - when I try with one of mine:
SELECT dbo.GetFirstWord('hello there')
It works fine.
Except...that function doesn't look right: you don;t give a value to
@sal
at all, and you aren't using the parameter, so the result would always be NULL.
If I copy your code, and create teh function, then
select dbo.getnetsal(1)
works, and returns NULL for me OK.
I'd check (in SSMS under "Programmability...Functions...Scalar-valued functions") that the function is in the right DB and that you are executing the SELECT query against that DB.