create proc p_mod_mxl
@xml ntext --注意:如果不用ntext或nvarchar型別,xml內容裡有中文會報錯。
as
declare @idoc int
exec sp_xml_preparedocument @idoc output, @xml
select *
from openxml (@idoc, '/std002/row', 1)
with (
id ntext 'newsid/.',
title ntext 'newstitle/.',
content ntext 'newscontent/.')
exec sp_xml_removedocument @idoc
/*
--呼叫儲存過程
exec p_mod_mxl '
1 li
content1 2
wang
content2
' */
go
參考:
SQL Server2005 新資料型別XML
在sql server2005中繼續延續了微軟在.net中的設計思想 將xml和.net緊密地結合到其中.用.net在sql2005中寫儲存過程定義函式我還沒有研究過,今天就只簡單得談談xml在sql2005中的應用.相對sqlserver2000而言,2005在資料型別上最大的一點改變就是增加了x...
SQL SERVER用儲存過程插入大量的資料
sql server儲存過程批量插入資料庫表資料 在做資料庫系統開發時,特別是需要對資料庫操作進行效能測試及優化時,我們就需要在資料庫測試表中插入大量資料以便測試。對於這些資料的插入,這裡通過例項展示如何通過儲存過程進行實現。資料庫表 userinfo 結構如下 createtable dbo us...
SQL SERVER 通用分頁儲存過程,兩種用法
從sqlserver 2005開始,提供了row number 函式,利用函式生成的index來處理分頁,按照正常的邏輯思維都是傳pageindex和pagesize來完成分頁,昨天前端和我溝通,他們使用jquery.datatable.js外掛程式,而且經過了公司底層的封裝,pageindex需要...