Hi,I'm trying to get a list of all missing fields.I managed to get the expected result, but it looks rather clumsy.The following is just an example, I have much more columns (and related tables) to check for, making it a huge query.Is there any way to improve it?
declare @tmpTable TABLE(ID int, Name varchar(50), Street varchar(50))insert into @tmpTable(ID,Name,Street)values(1,'Aline',NULL),(2,'Bert','Second Street'),(3,NULL,'Third Street')select ID,'Name'from @tmpTablewhere Name is nullunion allselect ID,'Street'from @tmpTablewhere Street is null
Thanks!