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
/**/
/*
更新最近更新时间
*/
查看全文
相关阅读:
2019-10-14-云之幻-UWP-视频教程
2019-10-14-云之幻-UWP-视频教程
2018-2-13-win10-uwp-自定义控件-SplitViewItem
2018-2-13-win10-uwp-自定义控件-SplitViewItem
2019-9-19-dotnet-找不到-PostAsJsonAsync-方法
2019-9-19-dotnet-找不到-PostAsJsonAsync-方法
2018-5-28-WPF-Process.Start-出现-Win32Exception-异常
2018-5-28-WPF-Process.Start-出现-Win32Exception-异常
Java实现 LeetCode 606 根据二叉树创建字符串(遍历树)
Java实现 LeetCode 606 根据二叉树创建字符串(遍历树)
原文地址:https://www.cnblogs.com/ruanbl/p/509373.html
最新文章
实现网页页面跳转的几种方法(meta标签、js实现、php实现)
使用Dropbox搭建静态网站详细教程
前端性能优化(JavaScript篇)
对于移动设备页面尺寸的理解
js 中的submit 回调函数
【转自百度fex】fex-team/interview-questions
Html标签笔记
MongoDB---性能优化---(1)
二叉树总结—建树和4种遍历方式(递归&&非递归)
[LeetCode] Evaluate Reverse Polish Notation [2]
热门文章
POJ 1150 The Last Non-zero Digit 数论+容斥
ACM之跳骚---ShinePans
继承?静态代理?写一个自己的动态代理吧
Spring MVC JSON自己定义类型转换
Ajax系列之二:核心对象XMLHttpRquest
SCAN listener and Node listener – How does it work
Node.js的helloworld 程序
CF1166E The LCMs Must be Large
2018-12-27-WPF-从-DrawingVisual-转-BitmapImage-图片
2018-12-27-WPF-从-DrawingVisual-转-BitmapImage-图片
Copyright © 2011-2022 走看看