zoukankan
html css js c++ java
cs_Feed_UpdateFeedStatus///cs_FeedPost_GetPost///cs_FeedPost_GetPostFullDetails///cs_FeedPost_UpdatePosts
cs_FeedPost_UpdatePosts
ALTER
PROC
[
dbo
]
.cs_FeedPost_UpdatePosts
@FeedId
INT
,
@FeedItemList
NTEXT
AS
SET
NOCOUNT
ON
DECLARE
@idoc
INT
DECLARE
@FeedPosts
TABLE
(
FeedId
INT
,
Author
NVARCHAR
(
255
),
Title
NVARCHAR
(
255
),
Description
NTEXT
,
Source
NVARCHAR
(
255
),
GuidName
NVARCHAR
(
255
),
GuidIsPermaLink
BIT
,
Link
NVARCHAR
(
255
),
PubDate
DATETIME
,
CommentsUrl
NVARCHAR
(
255
),
EnclosureUrl
VARCHAR
(
255
),
EnclosureLength
BIGINT
,
EnclosureType
NVARCHAR
(
100
),
Creator
NVARCHAR
(
255
)
NULL
,
CommentApiUrl
NVARCHAR
(
255
)
NULL
,
CommentRssUrl
NVARCHAR
(
255
)
NULL
,
CommentCount
INT
NULL
)
/**/
/*
声明临时表
*/
EXEC
sp_xml_preparedocument
@idoc
OUTPUT,
@FeedItemList
/**/
/*
不知道是不是处理那个RSS文件什么的东西,看这好象有点像。再省略………………
*/
--
First off, let's move all the XML into the table variable.
INSERT
INTO
@FeedPosts
SELECT
C.FeedId,
C.Author,
C.Title,
C.Description,
C.Source,
C.GuidName,
C.GuidIsPermaLink,
C.Link,
C.PubDate,
C.CommentsUrl,
C.EnclosureUrl,
C.EnclosureLength,
C.EnclosureType,
C.Creator,
C.CommentApiUrl,
C.CommentRssUrl,
C.CommentCount
FROM
OPENXML(
@idoc
,
'
/feeds/feed
'
,
3
)
WITH
( FeedId
INT
,
Author
NVARCHAR
(
255
),
Title
NVARCHAR
(
255
),
Description
NTEXT
,
Source
NVARCHAR
(
255
),
GuidName
NVARCHAR
(
255
),
GuidIsPermaLink
BIT
,
Link
NVARCHAR
(
255
),
PubDate
DATETIME
,
CommentsUrl
NVARCHAR
(
255
),
EnclosureUrl
VARCHAR
(
255
),
EnclosureLength
BIGINT
,
EnclosureType
NVARCHAR
(
100
),
Creator
NVARCHAR
(
255
),
CommentApiUrl
NVARCHAR
(
255
),
CommentRssUrl
NVARCHAR
(
255
),
CommentCount
INT
)
AS
C
--
Insert missing posts
INSERT
INTO
cs_FeedPost
(
FeedId,
Author,
Title,
Description,
Source,
GuidName,
GuidIsPermaLink,
Link,
PubDate,
CommentsUrl,
EnclosureUrl,
EnclosureLength,
EnclosureType,
Creator,
CommentApiUrl,
CommentRssUrl,
CommentCount
)
SELECT
C.FeedId,
C.Author,
C.Title,
C.Description,
C.Source,
C.GuidName,
C.GuidIsPermaLink,
C.Link,
C.PubDate,
C.CommentsUrl,
C.EnclosureUrl,
C.EnclosureLength,
C.EnclosureType,
C.Creator,
C.CommentApiUrl,
C.CommentRssUrl,
C.CommentCount
FROM
@FeedPosts
AS
C
WHERE
C.GuidName
NOT
IN
(
SELECT
GuidName
FROM
cs_FeedPost
WHERE
FeedId
=
@FeedId
)
--
Update existing posts.
UPDATE
cs_FeedPost
SET
Author
=
C.Author,
Title
=
C.Title,
Description
=
C.Description,
Source
=
C.Source,
GuidName
=
C.GuidName,
GuidIsPermaLink
=
C.GuidIsPermaLink,
Link
=
C.Link,
PubDate
=
C.PubDate,
CommentsUrl
=
C.CommentsUrl,
EnclosureUrl
=
C.EnclosureUrl,
EnclosureLength
=
C.EnclosureLength,
EnclosureType
=
C.EnclosureType,
Creator
=
C.Creator,
CommentApiUrl
=
C.CommentApiUrl,
CommentRssUrl
=
C.CommentRssUrl,
CommentCount
=
C.CommentCount
FROM
@FeedPosts
AS
C
WHERE
cs_FeedPost.GuidName
=
C.GuidName
EXEC
sp_xml_removedocument
@idoc
cs_FeedPost_GetPostFullDetails
ALTER
PROC
[
dbo
]
.cs_FeedPost_GetPostFullDetails
@FeedId
INT
AS
SELECT
fp.FeedPostId,
fp.FeedId,
fp.Author,
fp.Title,
fp.Description,
fp.Source,
fp.GuidName,
fp.GuidIsPermaLink,
fp.Link,
fp.PubDate,
fp.CommentsUrl,
fp.EnclosureUrl,
fp.EnclosureLength,
fp.EnclosureType,
fp.Creator,
fp.CommentApiUrl,
fp.CommentRssUrl,
fp.CommentCount
FROM
cs_FeedPost fp,
cs_Feed f
WHERE
f.FeedId
=
fp.FeedId
AND
fp.FeedPostId
=
@FeedId
/**/
/*
再省略………………
*/
cs_FeedPost_GetPost
ALTER
PROC
[
dbo
]
.cs_FeedPost_GetPost
@FeedPostId
INT
AS
SELECT
FeedPostId,
FeedId,
Author,
Title,
Description,
Source,
GuidName,
GuidIsPermaLink,
Link,
PubDate,
CommentsUrl,
EnclosureUrl,
EnclosureLength,
EnclosureType,
Creator,
CommentApiUrl,
CommentRssUrl,
CommentCount
FROM
cs_FeedPost
WHERE
FeedPostId
=
@FeedPostId
/**/
/*
省略………………
*/
cs_Feed_UpdateFeedStatus
ALTER
PROC
[
dbo
]
.cs_Feed_UpdateFeedStatus
@FeedId
INT
,
@FeedStateId
INT
AS
UPDATE
cs_Feed
SET
FeedStateId
=
@FeedStateId
,
LastUpdateDate
=
GetDate
()
WHERE
FeedId
=
@FeedId
/**/
/*
更新最近更新时间
*/
查看全文
相关阅读:
JS生成Guid
MVC——分页
MVC入门——删除页
MVC入门——编辑页
MVC入门——详细页
MVC入门——列表页
MVC入门——增
pandas使用
简单线性回归预测实现
flask 自定义url转换器
原文地址:https://www.cnblogs.com/ruanbl/p/509373.html
最新文章
Django实战(15):Django实现RESTful web service
Django实战(14):让页面联动起来
Django实战(13):在session中保存购物车
Django实战(12):增加目录页,设定统一布局
Django实战(11):修改Model类
Django实战(10):单元测试
Django实战(9):实现Product的输入校验
CMOS Sensor的调试经验分享
tone mapping简介
c++ 动态判断基类指针指向的子类类型(typeid)
热门文章
AVS采用了哪些编码技术?
live555学习之基本类介绍及计划任务深度探讨
简析LIVE555中的延时队列
UML图中类之间的关系:依赖,泛化,关联,聚合,组合,实现
live555 中的socket的任务调度分析
live555学习之RTSP连接建立以及请求消息处理过程
Live555类结构
在Vs2012 中使用SQL Server 2012 Express LocalDB打开Sqlserver2012数据库
c# 扩展方法奇思妙用基础篇八:Distinct 扩展
IIS配置MVC网站
Copyright © 2011-2022 走看看