谁解释一下这个存储过程,给分加感激!速度
--更新文件引用declare@quotestable(urlnvarchar(255));insertinto@quotes(url)selectT.value('@u...
--更新文件引用
declare @quotes table(url nvarchar(255));
insert into @quotes(url)select T.value('@url', 'nvarchar(255)') from @doc.nodes('/page/file[@url]') X(T)
delete T from portal_files_quote T where page_id = @id;
insert into portal_files_quote([page_id], [file_id])
select distinct @id, F.id from @quotes T
inner join portal_files F on F.site_id = @site_id and F.path = T.url; 展开
declare @quotes table(url nvarchar(255));
insert into @quotes(url)select T.value('@url', 'nvarchar(255)') from @doc.nodes('/page/file[@url]') X(T)
delete T from portal_files_quote T where page_id = @id;
insert into portal_files_quote([page_id], [file_id])
select distinct @id, F.id from @quotes T
inner join portal_files F on F.site_id = @site_id and F.path = T.url; 展开
1个回答
展开全部
比较难的就是上面的xml解析,这个语句:
declare @quotes table(url nvarchar(255));
insert into @quotes(url)select T.value('@url', 'nvarchar(255)') from @doc.nodes('/page/file[@url]') X(T)
就是把@doc xml变量里面/page/file节点下的url解析出来插入表变量@quotes中。
语句你可以查下连接丛书:http://blog.csdn.net/flysun0311/article/details/5287969
declare @quotes table(url nvarchar(255));
insert into @quotes(url)select T.value('@url', 'nvarchar(255)') from @doc.nodes('/page/file[@url]') X(T)
就是把@doc xml变量里面/page/file节点下的url解析出来插入表变量@quotes中。
语句你可以查下连接丛书:http://blog.csdn.net/flysun0311/article/details/5287969
更多追问追答
追问
insert into portal_files_quote([page_id], [file_id])
select distinct @id, F.id from @quotes T
inner join portal_files F on F.site_id = @site_id and F.path = T.url;
这段话,insert那一句,表(*,*)是什么意思
追答
表示只插入表portal_files_quote 中page_id和file_id字段,其余字段保持默认值
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询