xml vs null value - OLAPFOREVE

12-Jul-07 04:30:01
create table tt (
a varchar(10) not null,
b varchar(10)  null
)
insert into tt values  ( '1',null )
select * from tt for xml path

result :

How can I display in the xml the null value of  column b like


OR


PS I dont what to use XSINIL

thanks for your help
button
 
 

xml vs null value - David Portas

12-Jul-07 04:45:54
On 12 Jul, 21:30, OLAPFOREVER <OLAPFORE...@>

SELECT a, COALESCE(b,'NULL') AS b
FROM tt FOR XML PATH;

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
button
 

xml vs null value - OLAPFOREVE

12-Jul-07 04:52:05
I know
but my question is How can I do thant without use isnull() or COALESCE()
button
 
INSERT problem