惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
D
Docker
Last Week in AI
Last Week in AI
IT之家
IT之家
F
Fortinet All Blogs
A
About on SuperTechFans
P
Proofpoint News Feed
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
博客园_首页
月光博客
月光博客
博客园 - 司徒正美
Y
Y Combinator Blog

博客园 - Chep

招聘 dotNet c# asp.net 、Windows Mobile 、iPhone 开发人员,工作地上海 iblogs博客程序1.0版 求一问题的解决方法 .TEXT 修改 二 - Chep [转载]防止盗链下载问题 微软.net精简框架常见问题及回答(中文版) 博客RSS 使用完全手册 主流 Blog 程序 添加 免责声明 Gif 文件格式译解 Visual Studio.Net鲜为人知的技巧 DotNet 网上资源 gif 文档 .net学习:显示/播放Gif动画 在.NET中实现彩色光标和自定义光标 创建基于 Microsoft .NET Framework 精简版的动画控件 Windows Mobile-一个新时代的开始 关于跨站验证 关于更新blog
对.text的修改(1)
Chep · 2005-05-17 · via 博客园 - Chep

--查找最新的图片
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[blog_GetNewImages]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[blog_GetNewImages]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE   Proc blog_GetNewImages
(


 @Count int,
 @IsActive bit
)
as
set rowcount @Count
Select blog_images.Title, blog_images.CategoryID, blog_images.Height, blog_images.Width, blog_config.Application, blog_config.Application+'/'+convert(varchar(8),blog_images.CategoryID)+'/t_'+blog_images.[File] as [File], blog_images.Active, blog_images.ImageID From blog_Images,blog_config
where blog_config.blogid=blog_images.blogid and blog_images.Active <> Case @IsActive When 1 then 0 Else -1 End
order by UploadTime desc


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

-----取得专题排行
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[blog_GetCategoriesTop]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[blog_GetCategoriesTop]
GO

CREATE Proc blog_GetCategoriesTop
(
 @IsActive bit=null,
 @CategoryType tinyint,
 @ParentID int=null,
 @Count int
)
As
set rowcount @Count
if(@ParentID is not null)
Begin
select  blog_LinkCategories.CategoryID, blog_config.Application,blog_LinkCategories.blogID,blog_LinkCategories.Title, blog_LinkCategories.Active,
blog_LinkCategories.CategoryType, blog_LinkCategories.[Description],ParentID ,t.blogcount
FROM blog_LinkCategories,blog_config,(select count(*) as blogcount ,categoryid from blog_links group by categoryid) t
where blog_config.blogid = blog_LinkCategories.blogID and blog_LinkCategories.ParentID=@ParentID and blog_LinkCategories.CategoryType = @CategoryType
and blog_LinkCategories.Active <> Case @IsActive When 1 then 0 Else -1 End and t.categoryid=blog_LinkCategories.CategoryID
ORDER BY blogcount desc;
End
Else
Begin
SELECT blog_LinkCategories.CategoryID,blog_config.Application,blog_LinkCategories.blogID, blog_LinkCategories.Title, blog_LinkCategories.Active,
blog_LinkCategories.CategoryType, blog_LinkCategories.[Description],ParentID,t.blogcount
FROM blog_LinkCategories ,blog_config,(select count(*) as blogcount ,categoryid from blog_links group by categoryid) t
where  blog_config.blogid = blog_LinkCategories.blogID and blog_LinkCategories.CategoryType = @CategoryType
and blog_LinkCategories.Active =@IsActive and t.categoryid=blog_LinkCategories.CategoryID
ORDER BY blogcount desc
End


GO