水滴石穿

渴望成为高手--Amy.Qiu
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2008年5月8日

摘要: 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) 编辑