2010-11-06 36 views
0

在我的正常参数查询中,我不能使用SET ANSI NULL。事实上,我想取出记录where first_name='Rupesh' or NULL但我只得到Rupesh名称记录。如何在Sql Server 2005中获得空记录

我有一个存储过程,否则我可以设置set ansi null off和能得到的所有记录...

我现在应该怎么办?

+1

把你的问题,请执行SQL语句。 – 2010-11-06 06:02:16

回答

1
where first_name is null or first_name = 'Rupesh' 
+0

你能告诉我在存储过程中set ansi null的作用是什么 – NoviceToDotNet 2010-11-06 07:02:35

+0

ANSI_NULLS - http://msdn.microsoft.com/zh-cn/library/ms188048.aspx – tidwall 2010-11-06 08:21:46

1

试试这个:

where isnull(first_name, 'Rupesh') = 'Rupesh' 
相关问题