在我的正常参数查询中,我不能使用SET ANSI NULL
。事实上,我想取出记录where first_name='Rupesh' or NULL
但我只得到Rupesh名称记录。如何在Sql Server 2005中获得空记录
我有一个存储过程,否则我可以设置set ansi null off
和能得到的所有记录...
我现在应该怎么办?
在我的正常参数查询中,我不能使用SET ANSI NULL
。事实上,我想取出记录where first_name='Rupesh' or NULL
但我只得到Rupesh名称记录。如何在Sql Server 2005中获得空记录
我有一个存储过程,否则我可以设置set ansi null off
和能得到的所有记录...
我现在应该怎么办?
where first_name is null or first_name = 'Rupesh'
你能告诉我在存储过程中set ansi null的作用是什么 – NoviceToDotNet 2010-11-06 07:02:35
ANSI_NULLS - http://msdn.microsoft.com/zh-cn/library/ms188048.aspx – tidwall 2010-11-06 08:21:46
试试这个:
where isnull(first_name, 'Rupesh') = 'Rupesh'
把你的问题,请执行SQL语句。 – 2010-11-06 06:02:16