Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
sir,

i have using c# . i have familier with oracle.but littile knowledge in C# with sqlserver. i have used to nvl function in oracle in user input data variable.
but isnull work with table columns is fien but not in variable.please help me
thanks in advance

What I have tried:

select * from table where handwheel = isnull(isnull('',null),'NA') ,here '' means variable is blank
Posted
Updated 18-Oct-16 2:02am
Comments
ZurdoDev 18-Oct-16 7:55am    
You don't have a variable. I don't understand what you are asking. IsNull is very easy to use.

SELECT * FROM table WHERE handwheel = IsNull(@someVariable, 'valueVarisNull')

1 solution

It's not entirely clear what you're having a problem with but in the case of your SELECT statement:
SELECT fieldlist FROM table WHERE handwheel IS NULL OR handwheel = 'NA'

seems to fit what you posted.

Try reading the documentation on SQL Server TSQL next time.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900