GUID is null

Hello,

I wonder if I can check a GUID field for NULL?

SELECT 
    [Extent1].[GameBankID] AS [GameBankID], 
    [Extent1].[referenceId] AS [referenceId], 
    [Extent1].[productCode] AS [productCode], 
    [Extent1].[quantity] AS [quantity], 
    [Extent1].[version] AS [version], 
    [Extent1].[requestDateTime] AS [requestDateTime], 
    [Extent1].[customerID] AS [customerID], 
    [Extent1].[password] AS [password], 
    [Extent1].[responseDateTime] AS [responseDateTime], 
    [Extent1].[initiationResultCode] AS [initiationResultCode], 
    [Extent1].[companyToken] AS [companyToken], 
    [Extent1].[used] AS [used], 
    [Extent1].[productDescription] AS [productDescription], 
    [Extent1].[currency] AS [currency], 
    [Extent1].[unitPrice] AS [unitPrice], 
    [Extent1].[totalPrice] AS [totalPrice], 
    [Extent1].[ApplicationCode] AS [ApplicationCode], 
    [Extent1].[estimateUnitPrice] AS [estimateUnitPrice], 
    [Extent1].[validatedToken] AS [validatedToken], 
    [Extent1].[signature] AS [signature], 
    [Extent1].[status] AS [status]
    FROM [dbo].[GameBanks] AS [Extent1]
	where productCode = '000000006446' & referenceId is null

Is this for Microsoft SQL Server?

use sqlteam
go

declare @nullguid UNIQUEIDENTIFIER = NEWID()

create table #GameBanks(referenceId UNIQUEIDENTIFIER null, 
productCode varchar(50), GameBankName nvarchar(50))
insert into #GameBanks
select null, '000000006446' ,'Chase' union
select NEWID() ,'000000006447' , 'Wamu'

select * From #GameBanks 
where productCode = '000000006446' 
and referenceId is null

drop table #GameBanks

Yes SQL Server

Yes, but you cannot use "&" to mean "AND" in a WHERE clause. You must use the word "AND" instead. & is a bit-wise operator only in SQL Server.

Just a quick observation.... That query looks very much like it has come from EntityFramework, if so, and if it is generating "&" rather than "AND" you might need to delve a little deeper into the app to see why...