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
/**/
/*
更新最近更新时间
*/
查看全文
相关阅读:
函数声明例子
税收工资分级
attribute函数
输出结果有误
scanf_s()函数与数组,运行环境VS2013
格式化输出
功能点介绍和用户场景
第二次作业合作版
word count
第一次作业
原文地址:https://www.cnblogs.com/ruanbl/p/509373.html
最新文章
《大型网站技术架构》读后感(一)
nginx监听多个端口
MAVEN本地下载、安装
oracle数据库中创建表空间和临时表空间,以及用户和密码以及设置密码永不过期
关于Java中截取字符串
Linux 系统查看tomcat控制台命令
Linux 网卡的解决方法
Linux两台服务器上互传文件
Linux下如何强制中断一个程序的执行?
Linux系统关闭防火墙端口
热门文章
Thumbnailator 压缩图片
Exception:System.Web.UI.ViewStateException: 无效的视图状态。 Client IP: 10.24.12.156 Port: 30862
JSR 310规范
mybatis 学习
C# txt 文件分割
InfluxDB 1.7.7下载
w3c 跨域请求规范
elasticsearch 5.2.2 安装
asp.net core mvc 读取文件
NPOI 导出excel 终极方法(图片、合并单元格)
Copyright © 2011-2022 走看看