Trying to convert SQL script from SQL Server T-SQL to GCP BigQuery SQL and need to maintain ansi nulls setting to ensure same results. Is there a way to make Google BigQuery return true when null = null is compared (i.e. 'null = null is true' below)?
Example for T-SQL and BigQuery showing different output:
--GCP BigQuery test:
begin
declare null1 string;
declare null2 string;
select case when null1 = null2 then 'null = null is true'
else 'null = null is false'
end as bqsqlnulltest;
end
-- T-SQL (SQL Server) test:
set ansi_nulls off;
declare @null1 varchar(30);
declare @null2 varchar(30);
select case when @null1 = @null2 then 'null = null is true'
else 'null = null is false'
end as tsqlnulltest;