Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SQL Server 2005的脚本编写_Sql Server_Tsql - Fatal编程技术网

Sql server SQL Server 2005的脚本编写

Sql server SQL Server 2005的脚本编写,sql-server,tsql,Sql Server,Tsql,此脚本仅适用于2008版本: 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('inser

此脚本仅适用于2008版本:

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
所以,我的问题是: 我如何才能在2008年(SQLServerManagementStudio)上编写代码,确保在2005年可以正常工作

备注:**工具>选项>SQL Server对象资源管理器>脚本>服务器版本的脚本**不起作用


Tks

管理工作室只是一个具有某种智能感知的文本编辑器。
如果你需要你的代码在2005年工作,你需要连接到一个2005框并在上面运行你的测试。

Management studio只是一个具有某种智能感知的文本编辑器。 如果你需要你的代码在2005年工作,你需要连接到一个2005年的盒子并在上面运行你的测试

XQuery: SQL type 'xml' is not supported in XQuery.