Using SQL Server 2005 how do I get the below statement or rather the output as i want it to be.
SELECT Id 'PatientId',
ISNULL(ParentId,'') 'ParentId'
FROM Patients
ParenId is a uniqueidentifier
that allows NULL
, but seems that query optimizer tries to also convert ''
back to uniqueidentifier
for the rows where ParentId = NULL
.As the title says that's the exact error info the query runner throws at my face!!
- How do i get the server to return empty string for
ParentId = NULL