1

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

1 Answer 1

1

Management studio is only a text editor with some intellisense. If you need your code to work in 2005, you need to connect to a 2005 box and run your tests on that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.