posted @ 2008-05-13 18:02 AmyQiu 阅读(345) 评论(0) 推荐(0) 编辑
摘要:
产品表产品表ID(主键) 货名 金额 1 电视 1002 手机 1503 衣服 50库存表库存表ID(主键) 产品表ID 打折 货存 <-----货存表只有三种状态 0,1,21 1 0.2 12 1 0.3 13 2 0.8 04 2 0.5 15 1 0.7 16 3 0.2 26 3 0.7 16 3 0.1 0我要得到以下结果统计产品表货名 赢亏 <----计算 是否打折 &l... 阅读全文
摘要:
1)用系统函数select * from fn_dblog(null,null) 2)用DBCCdbcc log(dbname,4) --(n=0,1,2,3,4)1 - 更多信息plus flags, tags, row length2 - 非常详细的信息plus object name, index name,page id, slot id3 - 每种操作的全部信息4 - 每种操作的全部信息... 阅读全文
posted @ 2008-05-09 15:32 AmyQiu 阅读(3886) 评论(0) 推荐(0) 编辑
摘要:
create table #month_max(id int,dianliang decimal(18,2),Dt datetime)insert into #month_maxselect 1, 36800.2, '2008-04-21 11:38:12.000'union all select 1, 36300.2, '2008-04-18 07:32:39.000'union allsele... 阅读全文
posted @ 2008-05-08 10:34 AmyQiu 阅读(263) 评论(0) 推荐(0) 编辑
摘要:
drop table #aselect identity(int,1,1) as Id, table_name, column_name, Is_Nullable, Data_Typeinto #a from INFORMATION_SCHEMA.COLUMNS where column_name='ModelID' and Data_Type<>'Bigint'select * fr... 阅读全文
posted @ 2008-05-08 10:31 AmyQiu 阅读(582) 评论(0) 推荐(0) 编辑
摘要:
declare @dropSQL nvarchar(max)set @dropSQL=N''select distinct @dropSQL=@dropSQL+'ALTER TABLE dbo.'+table_name+' DROP CONSTRAINT '+constraint_name+';' from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGEEXE... 阅读全文
posted @ 2008-05-08 10:29 AmyQiu 阅读(548) 评论(0) 推荐(0) 编辑
摘要:
CREATE PROCEDURE test @uname varchar(10) AS BEGINENDdeclare @text nvarchar(4000)select @text=replace(text,'@uname varchar(10)', '@uname varchar(20)')from syscomments where id=object_id('test')drop pro... 阅读全文
posted @ 2008-05-08 10:27 AmyQiu 阅读(351) 评论(0) 推荐(0) 编辑
摘要:
//txtDate.Attributes.Add("onfocus", "setdate(this);");var bMoveable=true; var _VersionInfo="Version:2.02
2.01&02 Author: Athos;2.0 Author:walkingpoison
1.0 Author: F.R.Huang(meizz)
MAI... 阅读全文
posted @ 2007-05-23 16:28 AmyQiu 阅读(366) 评论(0) 推荐(0) 编辑
摘要:
create table row_to_column(code int,name varchar(10),value int)insert into row_to_columnselect 1,'name1',20unionselect 2,'name1',30unionselect 1,'name2',30unionselect 2,'name2',30unionselect 3,'name3'... 阅读全文
posted @ 2007-05-23 15:58 AmyQiu 阅读(652) 评论(0) 推荐(0) 编辑