This script works only in 2008 version:
declare @tab table(
id_emp int,
FIL_ROT_WID xml
)
insert into @tab
select 0, '<xml></xml>'
declare @xml_rot_widget xml
set @xml_rot_widget = '<ati id="1123" val="new()" />'
update @tab
set FIL_ROT_WID.modify('insert sql:variable("@xml_rot_widget")
as last
into (/xml)[1]')
where id_emp = 0
select * from @tab
In 2005 I receive the follow error:
XQuery: SQL type 'xml' is not supported in XQuery.
So, my question is: How can I write code on 2008 (SQL Server Management Studio) that I will be sure that will works fine on 2005?
Ps.: ** Tools > Options > SQL Server Object Explorer > Scripting > Script for server version** does not work.
Tks