xml是什么入参格式 存储过程_SQL存储过程-新增和修改,参数Xml数据类型

/****** Object: Procedure [dbo].[UP_ConfScheduled_AddScheduledConf] Script Date: 2014-3-17 9:16:26 ******/

USE [ytSummitTeleConf_DB];GO

SET ANSI_NULLS ON;GO

SET QUOTED_IDENTIFIER ON;GO

/*=============================================================

=============================================================*/

CREATE PROCEDURE [dbo].[UP_ConfScheduled_AddScheduledConf]

@BookConfXML,@MemberListXMLAS

SET NOCOUNT ON

/*--预约会议信息

4F3A595F-DCAF-49DD-806F-1E4BA0F58D33

254941

C8C71FAE-8365-4501-8EC0-4C32120A5CE3

2014-2-2会议

2014-1-17 0:00:00

1

0

2014-1-17 11:56:27

10

0

--预约会议成员列表

01052810000,8312

主持人

1

C8C71FAE-8365-4501-8EC0-4C32120A5CE3

2014-1-17 11:55:02

True

*/

DECLARE

@ConfRoom UNIQUEIDENTIFIER,@BookTime DATETIME

SELECT

@BookTime = T.c.value('(./BookTime/text())[1]', 'DATETIME'),@ConfRoom = T.c.value('(./ConfRoom/text())[1]', 'UNIQUEIDENTIFIER')FROM @BookConf.nodes('Root') AST(c)IF EXISTS(SELECT 1

FROMdbo.WTC_TB_BOOKCONFWHERE CONFROOM = @ConfRoom)BEGIN

UPDATEASET A.BookTime =B.BookTime,

A.ConfTitle=B.ConfTitle,

A.ConfType=B.ConfType,

A.AddConfMode=B.AddConfMode,

A.WRITETIME=B.WRITETIME,

A.[Status] = B.[Status],

A.IsRecord=B.IsRecord,

A.MasterMebID=B.MasterMebIDFROMdbo.WTC_TB_BOOKCONF AINNER JOIN(SELECTBookTime= @BookTime,

SeqNo= T.c.value('(./SeqNo/text())[1]', 'INT'),

ConfRoom= @ConfRoom,

ConfTitle= T.c.value('(./ConfTitle/text())[1]', 'VARCHAR(256)'),

ConfType= T.c.value('(./ConfType/text())[1]', 'TINYINT'),

AddConfMode= T.c.value('(./AddConfMode/text())[1]', 'TINYINT'),

WRITETIME= T.c.value('(./WriteTime/text())[1]', 'DATETIME'),[Status] = T.c.value('(./Status/text())[1]', 'TINYINT'),

IsRecord= T.c.value('(./IsRecord/text())[1]', 'TINYINT'),

MasterMebID= T.c.value('(./MasterMebID/text())[1]', 'UNIQUEIDENTIFIER')FROM @BookConf.nodes('Root') AST(c)

) BON A.CONFROOM =B.ConfRoomEND

ELSE

BEGIN

INSERT INTOWTC_TB_BOOKCONF

(

BOOKTIME,

SeqNo,

CONFROOM,

CONFTITLE,

CONFTYPE,

ADDCONFMODE,

WRITETIME,[STATUS],

IsRecord,

MasterMebID

)SELECTBookTime= T.c.value('(./BookTime/text())[1]', 'DATETIME'),

SeqNo= T.c.value('(./SeqNo/text())[1]', 'INT'),@ConfRoom,

ConfTitle= T.c.value('(./ConfTitle/text())[1]', 'VARCHAR(256)'),

ConfType= T.c.value('(./ConfType/text())[1]', 'TINYINT'),

AddConfMode= T.c.value('(./AddConfMode/text())[1]', 'TINYINT'),

WRITETIME= T.c.value('(./WriteTime/text())[1]', 'DATETIME'),[Status] = T.c.value('(./Status/text())[1]', 'TINYINT'),

IsRecord= T.c.value('(./IsRecord/text())[1]', 'TINYINT'),

MasterMebID= T.c.value('(./MasterMebID/text())[1]', 'UNIQUEIDENTIFIER')FROM @BookConf.nodes('Root') AST(c)END

IF EXISTS(SELECT 1

FROMdbo.WTC_TB_BOOKCONFQUEUEWHERE CONFROOM = @ConfRoom)BEGIN

UPDATEdbo.WTC_TB_BOOKCONFQUEUESET BOOKTIME = @BookTime

WHERE CONFROOM = @ConfRoom

END

ELSE

BEGIN

INSERT INTOdbo.WTC_TB_BOOKCONFQUEUE

(

CONFROOM,

BOOKTIME,[STATUS])VALUES(@ConfRoom,@BookTime,0)END

IF EXISTS(SELECT 1

FROM dbo.WTC_TB_BOOKMEMBER WITH(NOLOCK)WHERE CONFROOM = @ConfRoom)BEGIN

DELETEdbo.WTC_TB_BOOKMEMBERWHERE CONFROOM = @ConfRoom

END

INSERT INTOdbo.WTC_TB_BOOKMEMBER

(

MebID,

CONFROOM,

PHONENO,

PHONENOTE,

MEMBERTYPE

)SELECTMebGuid= T.c.value('(./MebGuid/text())[1]', 'UNIQUEIDENTIFIER'),

ConfRoom= @ConfRoom,

Phoneno= T.c.value('(./Phoneno/text())[1]', 'VARCHAR(32)'),

Name= T.c.value('(./Name/text())[1]', 'VARCHAR(128)'),

Mode= T.c.value('(./Mode/text())[1]', 'TINYINT')FROM @MemberList.nodes('Root/Member') AST(c)GO

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值