2010-11-06 70 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' 
相關問題