开发者

how to get null records also in Sql Server 2005

开发者 https://www.devze.com 2023-01-23 23:44 出处:网络
Can\'t I use SET ANSI NULL in my normal parametrize query. In fact I want to take out records where first_name=\'Rupesh\' or NULL but I am getting only the Rupesh name records.

Can't I use SET ANSI NULL in my normal parametrize query. In fact I want to take out records where first_name='Rupesh' or NULL but I am getting only the Rupesh name records.

I have a stored procedure otherwise I could set set ansi null off and could get all records...

What sh开发者_如何学Pythonould I do now?


where first_name is null or first_name = 'Rupesh'


Try this:

where isnull(first_name, 'Rupesh') = 'Rupesh'
0

精彩评论

暂无评论...
验证码 换一张
取 消