思考命运

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  SQL数据库

摘要:在sql server 2005 的新方法ROW_NUMBER做一个查询select row_number() over (order by ProductID) as Row,Name from Product可以看到返回结果中每条记录都有一个唯一的表示其序列号的标志。例如我们在分页中要获取的6到第10条记录就可以采用下面的方法select Row,Name from(select ROW_NUMBER() over(order by ProductID) as Row,Name from Product)as ProductsWithRowNumberswhere Row >= 6 阅读全文
posted @ 2012-08-16 02:21 思考命运 阅读(247) 评论(0) 推荐(0)

摘要:/********************************************************************* InstallSqlState.SQL Installs the tables, and stored procedures necessary for supporting ASP.NET session state. Copyright Microsoft, Inc. All Rights Reserved.********************************************************************... 阅读全文
posted @ 2012-08-16 02:15 思考命运 阅读(499) 评论(0) 推荐(0)

摘要:一、 引发 Session 丢失的几种原因动过手写代码的人都知道,Session 丢失是比较常见的事。以下是本人这几年所遇到的,能够引发 Session 丢失的原因,不敢说是百分百,丢失概率还是特别高的。错…,简直可以说是“相…当…”高哇 ^_^"1、 存放 Session 的电脑重启(废话,若这样都不丢,你神仙啊)2、 InProc 模式:aspnet_wp.exe 或 w3wp.exe 在“任务管理器”中或其它情况下导致其进程被终止运行。3、 InProc 模式:修改 .cs 文件后,编译了两次(只编译一次,有时不会丢失)4、 InProc 模式:修改了 Web.config5、 阅读全文
posted @ 2012-08-16 02:12 思考命运 阅读(418) 评论(0) 推荐(0)

摘要:using System; using System.Data; using System.Xml; using System.Data.SqlClient; using System.Collections; using System.Configuration;namespace BookDAL { /// <summary> /// SqlServer数据访问帮助类 /// </summary> public sealed class SqlHelper { #region 私有构造函数和方法private SqlHelper() { }/// <summa 阅读全文
posted @ 2012-08-15 23:57 思考命运 阅读(198) 评论(0) 推荐(0)

摘要:declare@valvarchar(100)declare@Sqlnvarchar(4000)set@Sql='Set @val=5' exec Sp_executeSql @Sql, N'@val varchar(100) output',@val outputselect@valas Value 阅读全文
posted @ 2012-08-15 15:20 思考命运 阅读(185) 评论(0) 推荐(0)

摘要:CREATE PROCEDURE [dbo].[Category_Delete] @CategoryId intAS--DELETE [Category] -- WHERE CategoryId=@CategoryId --DELETE [Category] -- WHERE FatherId=@CategoryId declare @taba TABLE([tabid] [int] NOT NULL) insert @taba (tabid) select CategoryId from Category WHERE FatherId=@CategoryId declare @id intw 阅读全文
posted @ 2012-08-15 15:13 思考命运 阅读(472) 评论(0) 推荐(0)