2007年3月17日

查询Sql server数据死锁和阻塞的一个Store procedure...

摘要: SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER procedure sp_who_lock as begin declare @spid int,@bl int, @intTransactionCountOnEntry in... 阅读全文

posted @ 2007-03-17 11:05 封起De日子 阅读(158) 评论(0) 推荐(0) 编辑

Asp.net 中的div 滚动条以及Css 的使用....

摘要: ---当控件的高度超出范围,自动出现上下,左右 拉动滚动条 控件 ----运行这段程序,滚动滚条时可以行到当行的位置 dsa... 阅读全文

posted @ 2007-03-17 10:40 封起De日子 阅读(344) 评论(0) 推荐(0) 编辑

Sql查找断号区间...

摘要: ---问题------查找断号区间 --建立測試環境Create Table TEST(ID Int)--插入數據Insert TEST Select 1Union All Select 2Union All Select 5Union All Select 6Union All Select 8... 阅读全文

posted @ 2007-03-17 10:30 封起De日子 阅读(259) 评论(0) 推荐(0) 编辑

将15位身份证升级成18位的用户定义Function...

摘要: ---问题-----将15位身份证升级成18位的用户定义函数CREATE FUNCTION ID15TO18 (@id15 char(15)) RETURNS CHAR(18) AS BEGIN DECLARE @ID18 CHAR(18) DECLARE @S1 AS INTEG... 阅读全文

posted @ 2007-03-17 10:26 封起De日子 阅读(165) 评论(0) 推荐(0) 编辑

一种BOM所用的Function...

摘要: ---问题---create table BOM(CODE varchar(4),C_CODE varchar(4),NUM int)insert into BOM select 'A','B',2insert into BOM select 'A','C',1insert into BOM se... 阅读全文

posted @ 2007-03-17 10:25 封起De日子 阅读(131) 评论(0) 推荐(0) 编辑

一段取值的sql...(charindex的应用)

摘要: ---问题---/*表test字段中field的值如下:aa,cd;ttttdd,pp;qq;ttd pptt,qqq;ttt;1oo;tt 希望把字段值都更新一下,取第一个","号前的值,如果没有","号则取";"前的值,如果值为空就还是为空,最终的值变成如下:aattddqq ppttoo*/... 阅读全文

posted @ 2007-03-17 10:21 封起De日子 阅读(151) 评论(0) 推荐(0) 编辑

Sql server identity字段的重新定位...

摘要: ---问题---/*create table t_t1 (id int identity(1,1),name varchar(10)) insert into t_t1 select 'xx1'union all select 'xx1'union all select 'xx1'union al... 阅读全文

posted @ 2007-03-17 10:16 封起De日子 阅读(110) 评论(0) 推荐(0) 编辑

Sql server 日期型与数值型的转换....

摘要: ---问题---/*现在遇到一个问题: 数据库是sql server2000,前台录入的是时间,但是数据库中存的确是int型,如果我要按照日期查找(例如找2007-3-12到2007-3-24的数据),我应该如何写sql语句. 假设表名为test,保存日期的字段名为open_date.*/ dec... 阅读全文

posted @ 2007-03-17 10:14 封起De日子 阅读(4208) 评论(0) 推荐(0) 编辑

Sql Server Some Question --Case...Whne...(2)

摘要: ----问题----/*在SQL server中,表为:create table tt1(id int identity(1,1),T_key varchar(10),T_value varchar(10),T_remark varchar(20))goinsert tt1 values('key... 阅读全文

posted @ 2007-03-17 10:12 封起De日子 阅读(104) 评论(0) 推荐(0) 编辑

Sql Server Some Question --Select Interzone(区间的) Data

摘要: ----问题----查找第10 - 20 的记录declare @tb_1 table(id int identity(1,1), name varchar(10)) declare @i intset @i=0 while @i<20begininsert into @tb_1 select '... 阅读全文

posted @ 2007-03-17 09:28 封起De日子 阅读(94) 评论(0) 推荐(0) 编辑

Sql Server Some Question --Case...Whne...(1)

摘要: --- 问题----1)给出你的问题的SQL脚本和样例数据,如:/*create table t( year int not null, --年度 s1 int, -- 一季度销售额 s2 int, -- 二季度销售额 s3 int, -- 三季度销售额 s4 int -- 四季度销售额 ) in... 阅读全文

posted @ 2007-03-17 09:23 封起De日子 阅读(113) 评论(0) 推荐(0) 编辑

导航