![](/Images/OutliningIndicators/ContractedBlock.gif)
cs_Feed_GetAll
ALTER PROC [dbo].cs_Feed_GetAll
(
@SettingsID int
)
AS
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
/**//*查询全部引用,好象越来越像是引用的意思了.*/
SELECT FeedId,
Url,
Title,
Link,
Language,
Generator,
SubscribeDate,
LastUpdateDate,
FeedStateId,
LastModified,
ETag
FROM cs_Feed
WHERE SettingsID = @SettingsID
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
GO
![](/Images/OutliningIndicators/ContractedBlock.gif)
cs_Feed_AddFeed
ALTER PROC [dbo].cs_Feed_AddFeed --应该是引用
@FolderId INT = NULL,
@UserId INT,
@Url NVARCHAR(255),
@SettingsID INT,
@FeedId INT OUTPUT
AS
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
DECLARE @NewFeedId INT
![](/Images/OutliningIndicators/None.gif)
-----------------------------------------------------------------------------
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
/**//*因为还不是很确定那个FEED到底是什么意思,所以暂时以RSS或者引用的意思来代替,反正就是
一个什么意思吧.不要太在意了.等我明白什么意思了在改,或者某人指点下*/
-----------------------------------------------------------------------------
![](/Images/OutliningIndicators/None.gif)
-- First, let's see if the feed is already registered.
--先查询是否此引用是否存在.
SELECT @NewFeedId = FeedId
FROM cs_Feed
WHERE Url = @Url and SettingsID = @SettingsID
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
-- If it's not, let's insert it and grab the FeedId.
-- 如果不存在则插入此引用并获取此ID
IF (@NewFeedId IS NULL)
BEGIN
-- Insert it.
INSERT INTO cs_Feed
(
Url,
SettingsID
)
VALUES
(
@Url,
@SettingsID
)
![](/Images/OutliningIndicators/None.gif)
-- Grab the identity generated.
--获取ID
SELECT @NewFeedId = @@IDENTITY
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
/**//*@@IDENTITY返回最后插入的标识值。*/
![](/Images/OutliningIndicators/None.gif)
END
![](/Images/OutliningIndicators/None.gif)
-- Add the feed to the user's folder.
-- 添加引用到用户的文件夹
INSERT INTO cs_FolderFeed
(
UserId,
FolderId,
FeedId,
SettingsID
)
VALUES
(
@UserId,
@FolderId,
@NewFeedId,
@SettingsID
)
![](/Images/OutliningIndicators/None.gif)
SELECT @FeedId = @NewFeedId
--返回ID
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
GO
posted on
2006-09-07 13:10
MainIsUsed
阅读(
160)
评论()
编辑
收藏
举报