怎么修改下面这个存储过程 [问题点数:50分,结帖人eimhee]

Bbs1
本版专家分:25
结帖率 99.43%
Bbs3
本版专家分:977
Bbs10
本版专家分:175035
Blank
红花 2008年12月 其他数据库开发大版内专家分月排行榜第一
2008年9月 其他数据库开发大版内专家分月排行榜第一
Blank
黄花 2014年7月 其他数据库开发大版内专家分月排行榜第二
2014年3月 其他数据库开发大版内专家分月排行榜第二
2013年7月 其他数据库开发大版内专家分月排行榜第二
2013年4月 其他数据库开发大版内专家分月排行榜第二
2012年3月 其他数据库开发大版内专家分月排行榜第二
2011年8月 其他数据库开发大版内专家分月排行榜第二
2011年7月 其他数据库开发大版内专家分月排行榜第二
2009年11月 其他数据库开发大版内专家分月排行榜第二
2009年7月 其他数据库开发大版内专家分月排行榜第二
2009年6月 其他数据库开发大版内专家分月排行榜第二
2009年5月 其他数据库开发大版内专家分月排行榜第二
2009年4月 其他数据库开发大版内专家分月排行榜第二
2009年3月 其他数据库开发大版内专家分月排行榜第二
2009年1月 其他数据库开发大版内专家分月排行榜第二
2008年10月 其他数据库开发大版内专家分月排行榜第二
2008年8月 其他数据库开发大版内专家分月排行榜第二
2003年9月 Delphi大版内专家分月排行榜第二
Blank
蓝花 2014年4月 其他数据库开发大版内专家分月排行榜第三
2013年10月 其他数据库开发大版内专家分月排行榜第三
2013年9月 其他数据库开发大版内专家分月排行榜第三
2013年6月 其他数据库开发大版内专家分月排行榜第三
2012年12月 其他数据库开发大版内专家分月排行榜第三
2012年11月 其他数据库开发大版内专家分月排行榜第三
2012年10月 其他数据库开发大版内专家分月排行榜第三
2012年9月 其他数据库开发大版内专家分月排行榜第三
2012年1月 其他数据库开发大版内专家分月排行榜第三
2011年11月 其他数据库开发大版内专家分月排行榜第三
2011年9月 其他数据库开发大版内专家分月排行榜第三
2011年6月 其他数据库开发大版内专家分月排行榜第三
2011年5月 其他数据库开发大版内专家分月排行榜第三
2011年4月 其他数据库开发大版内专家分月排行榜第三
2011年3月 其他数据库开发大版内专家分月排行榜第三
2010年11月 其他数据库开发大版内专家分月排行榜第三
2010年4月 其他数据库开发大版内专家分月排行榜第三
2010年1月 其他数据库开发大版内专家分月排行榜第三
2009年12月 其他数据库开发大版内专家分月排行榜第三
2009年2月 其他数据库开发大版内专家分月排行榜第三
2008年7月 其他数据库开发大版内专家分月排行榜第三
2008年6月 其他数据库开发大版内专家分月排行榜第三
2008年1月 其他数据库开发大版内专家分月排行榜第三
2007年12月 其他数据库开发大版内专家分月排行榜第三
2003年12月 Delphi大版内专家分月排行榜第三
2003年10月 Delphi大版内专家分月排行榜第三
这个存储过程怎么修改啊?
CREATE PROCEDURE Getremak (@SystemID Int)rnASrnrndeclare @sql varchar(200)rnselect @sql=SQLCom from Test1rn exec(''+@sql+'')rnGOrn表test SQLCom rn的一条记录是 Select * from Remark where SystemID=@SystemIDrnrn exec(''+@sql+'') 报错 必须声明变量 '@SystemID'。
这个存储过程的语法错误怎么修改
@ldNO char(25),rn@ldCurrentHourMount real,rn@tmpCurrentHourMount realrnASrn declare @cmd varchar(1000)rnrnIF EXISTS(select ld_no,@tmpCurrentHourMount = ld_currentHourMount FROM dbo.Precipitation WHERE ld_no = @ldNO)rn IF @ldCurrentHourMount >= @tmpCurrentHourMountrn UPDATE dbo.Precipitation SET ld_currentHourMount = @ldCurrentHourMount WHERE ld_no = @ldNOrnELSErn set @cmd = 'INSERT INTO dbo.Precipitation' + ' VALUES(''' + @ldNO + ''',' + ltrim(@ldCurrentHourMount)+ ')'rn exec(@cmd)rnrn错误如下:rn消息 102,级别 15,状态 1,过程 up_storePrecipitation,第 16 行rn'=' 附近有语法错误。rnrn就是这句话有错误rnIF EXISTS(select ld_no,@tmpCurrentHourMount = ld_currentHourMount FROM dbo.Precipitation WHERE ld_no = @ldNO)rn请问<em>怎么</em><em>修改</em>呢?
这个存储过程怎么修改
<em>存储过程</em>prc_viewjob:rnrnCREATE proc prc_viewjobrnasrndeclare @now datetimerndeclare @t_table tablern(rn[departid] int identity(1,1),rn[depart] varchar(50) primary key,rn[departnum] intrn)rnselect @now=getdate()-90rninsert into @t_tablern(rndepart,departnumrn)rnselect depart,count(depart) as departnum from empinfo where pubdate>@now group by depart order by departnum descrnselect * from @t_tablernGOrn当我执行上面的<em>存储过程</em>时,可以返回以下的数据:rn--------------------------------------------------rndepartid depart departnumrnrn26 chus 1rn7 cwn 48rn16 dldq 8rn6 dz 51rn9 fdc 37rn10 fwhq 36rn8 ggsj 47rn14 gy 24rn21 hjph 2rn19 hxgc 5rn20 jdyx 4rn11 jg 31rn13 jr 26rn3 jsj 161rn15 jx 23rn2 jy 215rn24 phjs 1rn18 qgn 6rn4 qt 89rn--------------------------------------rn我现在数据库里还有另外的一个表 jobnumrn部分数据显示如下:rn-----------------------------------------rnID depart departnum departnamernrn1 jsj ===计算机类===rn2 dz ==电子/邮电/通讯类=rn3 jy ==经营/管理/策划类==rn4 scyx ==市场销售/营销类==rn5 jr ==金融/经济/贸易类=rn6 gy ===工业/工厂类===rn7 jg ===技工===rn8 jx ==机械/设备维修类==rn9 dldq ===动力电气类===rn10 wz ===文职类===rn11 wjfl ===文教法律类===rn...................................................rn上面的jobnum表中,depart列与<em>存储过程</em>prc_viewjob执行结果中的depart是相对应的,比如,jobnum表的depart列有值为jsj,而prc_viewjob执行结果中的departname列也有个jsj值.rnrn我现在想<em>修改</em>一下<em>存储过程</em>prc_viewjob,我想更新jobnum表中的departnum值,其值就是<em>存储过程</em>prc_viewjob执行结果中的departnum对应的值.rnrn举个例子:rn 执行结果中depart等于jsj的departnum=161,我现在就是要更新jobnum表中,对应depart为jsj的departnum为161.相应其他的depart值也要实现更新!rn
这个存储过程应该怎么修改
CREATE PROCEDURE Pr_GetYouHuoSearchrn (rn @strCityName nvarchar(50),rn @reachCityName nvarchar(50),rn @goodsClass nvarchar(50),rn @goodsWeigh nvarchar(50),rn @CurrPage int,rn @PageSize intrn )rnASrnrn /*定义局部变量*/rndeclare @intYouHuoCount intrndeclare @intRowCount intrndeclare @intBeginID intrndeclare @intEndID intrndeclare @intPageCount int rndeclare @sql nvarchar(2000)rn/*关闭计数*/rnset nocount onrnrn/*求总共有货信息数*/ rnselect @intYouHuoCount=count(*) from dbo.YN_channel_wyhptrnif(@intYouHuoCount=0)--结果为空返回0rnreturn 0rnrn/*判断页数是否正确*/rnif(@CurrPage-1)*@PageSize>@intYouHuoCountrnreturn (-1)rnrn/*求当前页开始rootID*/rnset @intRowCount=(@CurrPage-1)*@PageSize+1rnif @intRowCount rnend rnexec(@sql)rnreturn(@@rowcount)rn
下面这个存储过程怎么错了??????????急等
create or replace procedure testrn(rnv_delflg in varchar2, rnv_withdata in varchar2, rnv_columnList in varchar2, rnRefCur_MasterBO out varchar2,rnv_totalCount out varchar2rn) rnasrnbeginrn --SELECT F001,F002,F003,F004,F005,F006,F007,UPDID,UPDDT FROM TMDR01;rn RefCur_MasterBO := '1';rn --v_totalCount := select count(*) from TMDR01;rnend test;rnrnrn注释掉的2句话<em>怎么</em>错了????
怎么提高下面这个统计的存储过程的执行效率
<em>存储过程</em>的全部内容如下:rn主要是统计应处结数、及时率等等。现在统计一年内的数据就很慢,要好几秒,<em>怎么</em>提高呢rnALTER PROCEDURE [dbo].[proc_CaseRateByUnit]rn @StartTime datetime='2013-05-21', --开始时间 2009-1-1rn @EndTime datetime='2013-12-01' , --终止时间 2009-2-1 rn @DataSource varchar(1000)='',--数据来源(分号隔开)rn @FaultCategory varchar(1000)=''--故障类别(分号隔开)rnASrnset nocount on rnrn--建立来源表rnif exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Report_DataSource')) rnbeginrn drop table #Report_DataSourcernend rnCREATE TABLE [#Report_DataSource] ( rn [DataSourceCode] [varchar] (5) NULL--来源编号 rn) rnrn--字符串分解到表里rnif(@DataSource<>'')rnbeginrn insert #Report_DataSourcern select * from dbo.Fun_splitStr(@DataSource,';') --------------把选择的来源编号放到#Report_DataSource里rnendrnelsernbegin --全部rn insert #Report_DataSource select [SourceCode] FROM [dbo].[T_DataSource] where [IsDeleted]='0'---------------否则就是所有的来源编号rnendrn--建立故障类别表rnif exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Report_FaultCategory')) rnbeginrn drop table #Report_FaultCategoryrnend rnCREATE TABLE [#Report_FaultCategory] ( rn [FaultCategoryCode] [varchar] (10) NULL-- 编号 rn) rn--字符串分解到表里rnif(@FaultCategory<>'')rnbeginrn insert #Report_FaultCategoryrn select * from dbo.Fun_splitStr(@FaultCategory,';') rnendrnelsernbegin --全部rn insert #Report_FaultCategory select FaultCode FROM dbo.T_FaultCategory where [IsDeleted]='0'--------------故障类别同来源编号处理rnend rnrn--初始化统计表rnif exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Report_mxx')) rnbegin rn drop table #Report_mxxrnendrnCREATE TABLE [#Report_mxx] ( rn [RecIdx] int IDENTITY (1, 1) NOT NULL,--自增序号 rn [IsChartItem] bit default 0 null,--是否在图表中显示 rn [UnitName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,--单位名称rn [UnitCode] [varchar] (20) NULL,--单位编号rn [DispatchCount] int default 0 NULL,--应处结工单数 rn [DispatchRate] [decimal](18,2) default 0.0 NULL,--所占比例rn [DisposeInTimeCnt] int default 0 null,--及时处结数rn [NoInTimeCnt] int default 0 NULL,--未及时处结数 rn [FinishInTimeRate] [decimal](18,2) default 0.0 NULL,--处结及时率rn [FinishCnt] int default 0 NULL,--处结数 rn [undoneCount] int default 0 NULL,--未处结工单数 rn [FinishRate] [decimal](18,2) default 0.0 NULL,--处结率rn [LinkrelativeRate] [decimal](18,2) default 0.0 NULL,--应处结数环比rn [YearToYearRate] [decimal](18,2) default 0.0 NULL,--应处结数同比 rn [Linkrelative] int default 0 NULL,--应处结数环比rn [YearToYear] int default 0 NULL--应处结数同比 rnrn) rnrn--插入单位rninsert #Report_mxx([UnitName],[UnitCode],IsChartItem)rnSELECT [UnitName] ,[UnitCode],'1' FROM [dbo].[T_OrganizationUnit] where ParentCode='0' and UnitCode not in('100000','100010','100020')rn--插入合计rninsert #Report_mxx([UnitName],[UnitCode],IsChartItem)rnvalues('合计','000000','0') rn--- 统计应处结工单数( 派单数)rnupdate #Report_mxxrn set [DispatchCount]=TblCnt.zsrn from (select processUnit,count(0) as zs from V_WorkOrderReport where rn (AcceptDate between @StartTime and @EndTime) rn and (FaultCategory is not null and WorkOrderType is not null) and processUnit is not nullrn and (FaultCategory<>'' and WorkOrderType<>'') and processUnit<>''rn and SendTime is not null and IsFlowed not in('0','3')rn and DataSource in (select [DataSourceCode] from #Report_DataSource)rn and FaultCategory in (select [FaultCategoryCode] from #Report_FaultCategory)rn group by processUnit ) as TblCnt,#Report_mxx as arn where a.[UnitCode]=TblCnt.processUnitrn-------- 及时处结数rn update #Report_mxxrn set [DisposeInTimeCnt]=TblCnt.zsrn from (select processUnit,count(0) as zs from V_WorkOrderReport as grn where (AcceptDate between @StartTime and @EndTime) rn and IsFlowed not in('0','3') rn and g.DataSource in (select [DataSourceCode] from #Report_DataSource)rn and g.FaultCategory in (select [FaultCategoryCode] from #Report_FaultCategory) rn and SendTime is not null rn and (g.FaultCategory is not null and g.WorkOrderType is not null) and g.processUnit is not nullrn and (g.FaultCategory<>'' and g.WorkOrderType<>'') and g.processUnit<>''rn and dateadd(s,ProcessLimit*3600,SendTime)>=isnull(AnswerTime,'1900-01-01') rn and workCode in(select BusinessCode from dbo.T_WorkFlowInstance where wfCode='10' and workflowState in('11','90'))rn group by processUnit) AS TblCnt,#Report_mxx as arn where a.[UnitCode]=TblCnt.processUnit rn--处结数rnupdate #Report_mxxrn set FinishCnt=TblCnt.zsrn from (select processUnit,count(0) as zs from V_WorkOrderReport as grn where (AcceptDate between @StartTime and @EndTime) and SendTime is not null and IsFlowed not in('0','3') rn and g.DataSource in (select [DataSourceCode] from #Report_DataSource) rn and g.FaultCategory in (select [FaultCategoryCode] from #Report_FaultCategory)rn and (g.FaultCategory is not null and g.WorkOrderType is not null) and g.processUnit is not nullrn and (g.FaultCategory<>'' and g.WorkOrderType<>'') and g.processUnit<>''rn and workCode in(select BusinessCode from dbo.T_WorkFlowInstance where wfCode='10' and workflowState in('11','90')) rn group by processUnit) AS TblCnt,#Report_mxx as arn where a.[UnitCode]=TblCnt.processUnit rn--环比数rnupdate #Report_mxxrn set [Linkrelative]=TblCnt.zsrn from (select processUnit,count(0) as zs from V_WorkOrderReport rn where (AcceptDate between dateAdd(month,-1,@StartTime) and dateAdd(month,-1,@EndTime))rn and SendTime is not null rn and (FaultCategory is not null and WorkOrderType is not null) and processUnit is not nullrn and (FaultCategory<>'' and WorkOrderType<>'') and processUnit<>''rn and IsFlowed not in('0','3')rn and DataSource in (select [DataSourceCode] from #Report_DataSource)rn and FaultCategory in (select [FaultCategoryCode] from #Report_FaultCategory)rn group by processUnit ) as TblCnt,#Report_mxx as arn where a.[UnitCode]=TblCnt.processUnitrn--同比数rnupdate #Report_mxxrn set [YearToYear]=TblCnt.zsrn from (select processUnit,count(0) as zs from V_WorkOrderReport rn where (AcceptDate between dateAdd(year,-1,@StartTime) and dateAdd(year,-1,@EndTime))rn and SendTime is not null rn and (FaultCategory is not null and WorkOrderType is not null) and processUnit is not nullrn and (FaultCategory<>'' and WorkOrderType<>'') and processUnit<>''rn and IsFlowed not in('0','3')rn and DataSource in (select [DataSourceCode] from #Report_DataSource)rn and FaultCategory in (select [FaultCategoryCode] from #Report_FaultCategory)rn group by processUnit ) as TblCnt,#Report_mxx as arn where a.[UnitCode]=TblCnt.processUnitrnrnrn---未处结数rnupdate #Report_mxxrnset [undoneCount]=[DispatchCount]-FinishCntrn-------- 未及时完成数rnupdate #Report_mxxrnset [NoInTimeCnt]=FinishCnt-[DisposeInTimeCnt] rnrnrn--统计合计rndeclare @SumDispatch int rnset @SumDispatch=(select sum([DispatchCount]) as zs from #Report_mxx where [UnitCode]<>'000000')rnupdate #Report_mxxrnset [DispatchCount]=@SumDispatchrnwhere [UnitCode]='000000' rnrnupdate #Report_mxxrnset [undoneCount]=TblCnt.zsrnfrom (select sum([undoneCount]) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rnupdate #Report_mxxrnset [DisposeInTimeCnt]=TblCnt.zsrnfrom (select sum([DisposeInTimeCnt]) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rnupdate #Report_mxxrnset [NoInTimeCnt]=TblCnt.zsrnfrom (select sum([NoInTimeCnt]) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rnupdate #Report_mxxrnset FinishCnt=TblCnt.zsrnfrom (select sum(FinishCnt) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rnrnupdate #Report_mxxrnset [Linkrelative]=TblCnt.zsrnfrom (select sum([Linkrelative]) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rnrnupdate #Report_mxxrnset [YearToYear]=TblCnt.zsrnfrom (select sum([YearToYear]) as zs from #Report_mxx where [UnitCode]<>'000000')rn as TblCnt,#Report_mxx as arn where a.[UnitCode]='000000' rn--所占比例rnupdate #Report_mxxrn set DispatchRate=case @SumDispatch when 0 then 0 else cast(isnull([DispatchCount],0) as decimal(9,2))/(CASE (@SumDispatch) WHEN 0 THEN 1 ELSE @SumDispatch END)*100 endrnrn---及时处结率rnupdate #Report_mxxrn set [FinishInTimeRate]=case [DispatchCount] when 0 then 0 else cast(isnull([DisposeInTimeCnt],0) as decimal(9,2))/(CASE ([DispatchCount]) WHEN 0 THEN 1 ELSE [DispatchCount] END)*100 endrn---处结率rnupdate #Report_mxxrn set [FinishRate]=case [DispatchCount] when 0 then 0 else cast(isnull([FinishCnt],0) as decimal(9,2))/(CASE ([DispatchCount]) WHEN 0 THEN 1 ELSE [DispatchCount] END)*100 endrn--环比比率rnupdate #Report_mxxrn set LinkrelativeRate=case Linkrelative when 0 then 0 else (cast(isnull(DispatchCount,0) as decimal(9,2))-cast(isnull(Linkrelative,0) as decimal(9,2)))/(CASE (isnull(Linkrelative,0)) WHEN 0 THEN 1 ELSE Linkrelative END)*100 endrnrn--同比比率rnupdate #Report_mxxrn set YearToYearRate=case Linkrelative when 0 then 0 else (cast(isnull(DispatchCount,0) as decimal(9,2))-cast(isnull(YearToYear,0) as decimal(9,2)))/(CASE (isnull(YearToYear,0)) WHEN 0 THEN 1 ELSE Linkrelative END)*100 endrnrnselect [RecIdx] ,IsChartItem,rn [UnitName],rn [UnitCode],rn [DispatchCount],rn cast([DispatchRate] as varchar(10))+'%' as [DispatchRate],rn [DisposeInTimeCnt],rn [NoInTimeCnt],rncast([FinishInTimeRate] as varchar(10))+'%' as [FinishInTimeRate], rn [FinishCnt],rn [undoneCount],rncast([FinishRate] as varchar(10))+'%' as [FinishRate], rncast([LinkrelativeRate] as varchar(10))+'%' as [LinkrelativeRate], rncast([YearToYearRate] as varchar(10))+'%' as [YearToYearRate] rn from #Report_mxx
下面这个语句怎么存储过程~写
if object_id('Tempdb..#shop_snsn') is not nullrndrop table #shop_snsnrnselect rnshop_snsn.cjname,bt.kucunrninto #shop_snsnrnfrom bt join shop_snsn on bt.isbn = shop_snsn.cjname and shop_snsn.shopclass=2 and shop_snsn.kucun<>bt.kucunrncreate index IX_#shop_snsn on #shop_snsn(cjname)rnrnSET ROWCOUNT 200;rnwhile exists(select 1 from #shop_snsn)rnbegin rnupdate arnset kucun=b.kucunrnfrom rnshop_snsn arnjoinrn#shop_snsn b on a.cjname=b.cjname and a.shopclass=2rndelete b from shop_snsn a join #shop_snsn b on a.cjname=b.cjname and a.shopclass=2 and a.kucun=b.kucunrnendrnSET ROWCOUNT 0
下面修改存储过程所属的用户????
我创建了一些<em>存储过程</em>但是用sa登录创建的~查看<em>存储过程</em>的所属着是dbo,我新键了别的用户~<em>怎么</em>样创建的<em>存储过程</em>的所有者是新键的用户啊 ???rnrnrn
怎样修改这个存储过程
USE GroupBlogsystemrnIF EXISTS(SELECT name FROM sysobjectsrn WHERE name='AddNews'rn AND type='P')rnDROP PROCEDURE AddNewsrnGOrnUSE GroupBlogSystemrnGOrnCREAT PROCEDURE AddNews @UserID uniqueidentifier,rn @Title varchar(100),rn @Updatetime datetime,rn @UpdaterName varchar(50)rnASrn/******************************************rnDESCRIPTION:添加新闻rn******************************************/rnINSERT INTO NEWS (UserID,Title,Updatetime,UpdaterName,Hit) VALUES(rn @UserID,rn @Title,rn @Updatetime,rn @UpdaterName,rn 0)rnGOrnrn请各位帮我看看为什么会有“必须声明变量◎UserID”的错误呀?!rn谢谢了?!
修改这个存储过程
[code=SQL]rnALTER PROCEDURE [dbo].[P_Chat_Sel_Update]rn @itID int,rn @strPid nvarchar(50),rn @strMstTo nvarchar(50)rnASrnBEGINrn select top 1 ID,msg,date from chat where pid=@strPid and msgTo=@strMstTo and isread=0rn --参数@itID等于上面查询出来的ID,上面那个查询任然要执行出结果rn set @itID=???rn UPDATE chat set isread=1 where ID =208;rnEND[/code]
帮我看看这个存储过程怎么修改
ALTER PROCEDURE spzbb rn @begindate datetime,rn @enddate datetimernASrn declare @spbm varchar(50),rn @spmc varchar(100),rn @spgg varchar(150),rn @jhsl decimal(18,0),rn @jhje decimal(18,2),rn @xssl decimal(18,0),rn @xsje decimal(18,2),rn @jeb decimal(18,2)rnrnDECLARE @pro_cursor_spbm CURSORrnrnSET @pro_cursor_spbm = CURSOR FORrn SELECT DISTINCT spbm,spmc,spgg FROM jhsprnrnOPEN @pro_cursor_spbmrnrnFETCH next FROM @pro_cursor_spbm INTO @spbm,@spmc,@spggrnWHILE (@@FETCH_STATUS = 0)rnrnrnBEGINrn select @jhsl=isnull(sum(jhsp.jhsl),0),@jhje=isnull(sum(jhsp.jhzj),0)rn from jhd,jhsprn where jhd.jhbh=jhsp.jhbh and spbm = @spbm ANDrn datediff(dd,jhrq,@begindate)=0 rnrn select @xssl = isnull(sum(xssp.xssl),0),@xsje=isnull(sum(xssp.xszj),0)rn from xsd,xssp rn where xsd.xsbh=xssp.xsbh and spbm = @spbm ANDrn xssp.spbm in (select jhsp.spbm from jhd,jhsp where jhd.jhbh=jhsp.jhbh and datediff(dd,jhd.jhrq,@begindate)=0)rnrn set @jeb=(@xsje - @jhje)rnrnrnSELECT @spbm,@spmc,@spgg,@jhsl,@jhje,@xssl,@xsje,@jeb rnrn FETCH next FROM @pro_cursor_spbm INTO @spbm,@spmc,@spggrnrnENDrnrn<em>存储过程</em>没问题,主要是返回的是有多少条记录就有多少个结果集,我想<em>修改</em>成一个结果集里存放多条记录。先谢谢大家了!
这个存储过程出错了,怎么修改
<em>存储过程</em>功能:判断一个表是否存在,如果不存在就新建表;如果存在,就先截断表,然后删除表,最后新建一个表。rnrnrnCREATE OR REPLACE PROCEDURE ExCreatern(rn TableName varcha2,rn RetValue out intrn)rnasrn i int;rnbeginrn select count(*) into i from all_tables a where a.table_name =TableName ;rn if i=0 then // 如果表不存在就创建表rn beginrn RetValue:=1; rn rn /* ???????? 这里的创建表在oracle sql编译出错。 rn 出现符号Create在需要下列之一:....rn begin case declare exitrn for goto if loop mod null pragma raise return select updatern while with rn < pipe*/rnrn Create Table TableName( TelNo varchar2(20),rn constraint idx_number primary key(TelNo)) ; rn end;rn else // 表存在就先截断表然后删除表,再新建表rn beginrn RetValue:=2;rn truncate table TableName; // 截断表rnrn RetValue :=3; rn drop table TableName; // 删除表rnrn RetValue :=4;rn Create Table TableName // 新建表rn ( TelNo varchar2(20),rn constraint idx_number primary key(TelNo)) ; rnrn RetValue:=5;rn end;rn end if;rnrn exception when others // 异常处理rn then rn RetValue:=-2500;rn return ('执行<em>存储过程</em>失败'); rnend;
下面这个怎么理解
先看看<em>这个</em>:)rn....................rnrnrnrn然后看看<em>下面</em><em>这个</em><em>怎么</em>理解?rn rn
下面存储过程 怎么应用事务?
create proc insert_two_tablern@a int,rn@b int,rnasrnrnbeginrninsert into table1(a)values(@a)rninsert into table2(b)values(@b)rnrnendrnrn怎样保证 两个表操作同时成功???rnrn谢谢
怎么修改DB2的存储过程
我用QUEST能<em>修改</em>么
怎么修改存储过程的所有者
用原来用户创建的用户<em>存储过程</em>rn新建了个用户如何让新建的用户 rn访问原来的<em>存储过程</em>
怎么修改存储过程的名子?
用Sql语言<em>怎么</em><em>修改</em><em>存储过程</em>的名子?谢谢
存储过程怎么修改
该<em>存储过程</em>针对工厂库存式生产,以时间段和厂别cb为筛选条件,算出产品的日销量来统计出产品的安全存量,并设置一个安全天数ts. 但主表mtlname无cb字段,则<em>修改</em>的ts无法以cb筛选.请教<em>怎么</em><em>修改</em>.如cb='H'或cb='K'可分别设置ts.平台为SQL2000,程序为delphi 6.0编写.在程序上<em>修改</em>亦可.谢谢啦帖子有限只发出一部分.rnCREATE PROCEDURE sp_mtlscst @bdate varchar(10),@edate varchar(10) ,@type int ,@mtlcode varchar(30) ,@cb varchar(2) asrndeclare @tday intrnset @tday = DATEDIFF(dd, cast(@bdate as datetime) , cast(@edate as datetime) )+1rnupdate mtlname set maxqty=0 where maxqty is nullrnupdate mtlname set ts=0 where ts is nullrnif (@type =0 ) or ( @type =1)rnbeginrn -----庫存材料可做成品數----rn select mtlname.mtl_class,mtlprice.mtl_code as cp_code, sum(isnull(st_qty,0)) as st_qtyrn into #t0 rn from rn mtlwhst,rn mtlname,rn mtlpricern where rn mtlwhst.mtl_code=mtlname.mtlcode and rn mtlname.mtl_class = mtlprice.mtl_cl and rn ((@cb='' and mtlprice.cb='') or rn (@cb<>'' and charindex(mtlprice.cb,@cb)<>0)) and rn --and( substring(mtlwhst.mtl_code,1,1) ='A' or substring(mtlwhst.mtl_code,1,1) ='B' )rn exists ( select class from mtlclass as d where substring(d.class,1,1)='A' and d.class=mtlname.mtl_class) and rn mtlwhst.whno <>'AG' and rn exists(select whno from mtlwhcode as a where a.whno=mtlwhst.whno and (@cb='' or (@cb<>'' and charindex( a.cb, @cb)<>0 )) )rn group by rn mtlname.mtl_class,rn mtlprice.mtl_codern select *, (select top 1 isnull( round(b.l*b.h*6*c.wz,4),0) as dz from mtlprice as a ,mtlname as b,mtlcpset as c where a.mtl_cl = b.mtlcode and a.mtl_code= cp_code ) as dzrn into #t01 rn from #t0rn select *,case when dz<>0 then st_qty/dz else 0 end as pc rn into #t1 rn from #t01rn drop table #t0rn drop table #t01rn ---------------------提日均銷售日量-------------rn select rn mtl_code ,rn round(sum(isnull(out_qty,0))/ @tday,2) as avgqty rn into #t2rn from rn mtloutde,rn mtlout rn where rn mtlout.outid =mtloutde.outid and rn mtlout.out_flag =1 and rn substring(mtl_code,1,1)='Y' and rn convert(varchar(10),mtlout.out_date,21) >=@bdate and --out_date 發貨日期rn convert(varchar(10),mtlout.out_date,21) <>0)) or (@cb='') ) --jh 4.24rn --(@cb='' or (@cb<>'' and charindex( mtlout.cb, @cb)<>0))rn group by mtl_codern --------------------末做庫存數 -----------------rn --------------------購入可做庫數--------------rn update mtlname rn set rn tavgmd =isnull((select top 1 avgqty from #t2 where #t2.mtl_code =mtlname.mtlcode),0),rn tordqty =0,---訂購可用庫存rn tscqty =0, -- 機頭可做庫存rn tstqty = isnull((select sum(st_qty) from mtlwhst where mtlwhst.mtl_code =mtlcodern and exists(select whno from mtlwhcode as a where a.whno=mtlwhst.whno and( @cb='' or (@cb<>'' and charindex( a.cb, @cb)<>0) )) ) ,0) , ---庫存成品rn tclst = isnull(( select sum(pc) from #t1 where #t1.cp_code=mtlcode),0 ),rn sjw =isnull((select top 1 c.l from mtlname as a ,mtlprice as b ,mtlname as c where a.mtlcode =b.mtl_code and b.mtl_code =mtlname.mtlcode and b.mtl_cl=c.mtlcode and( (@cb='' and b.cb='')or (@cb<>'' and charindex(b.cb, @cb)<>0 ) ) ),0)rn -- isnull((select top 1 l from mtlname as a ,mtlprice as b where a.mtlcode =b.mtl_code and b.mtl_code =mtlname.mtlcode and a.mtlcode=b.mtl_cl),0)rn where substring(mtlcode,1,1)='Y'--------------花胚rnrn update mtlname rn set tavgmd =isnull((select sum(avgqty) from #t2 where #t2.mtl_code like mtlname.mtlcode+'%'),0) rn from mtlname where substring(mtlcode,1,3)='YPH'rnrn update mtlname set rn ttotqty = isnull(tordqty,0) + isnull(tscqty,0) + isnull( tstqty,0) +isnull(tclst,0) , --總庫存rn tuseday = case when tavgmd <>0 then (isnull(tordqty,0) + isnull(tscqty,0) + isnull( tstqty,0)+isnull(tclst,0))/ tavgmd else 0 end, ----維持天數rn tday = case when tavgmd <>0 then isnull( tstqty,0)/ tavgmd else 0 end,rn tsfqty = tavgmd *ts --安全存量rn where substring(mtlcode,1,1)='Y'rnrn update mtlname setrn tneedqty =ttotqty -Maxqty , --總庫存差rn Tneedadd=tday-ts --tuseday -ts --天數差rn where substring(mtlcode,1,1)='Y'rn if @type =0 rn beginrn select Class_name,mtlcode,mtl_name,mtl_des,unit_name,ttotqty,tstqty,tclst,rntordqty,tscqty,tavgmd,tuseday,rn ts,---(convert(int,(select top 1 isnull(SafeDaysMin,0) from SafeStock as b where b.mtlcode=a.mtlcode and b.cb=@cb))) rn maxqty, rn tsfqty,rn tneedadd,rn tneedqty,rn @tday as ttday,rn tday ,rn oh ,rn (select b.Thickness from VMtlPrice as b where a.mtlcode = b.MtlCode and b.cb = @cb) as TrueH,rn sjw rn from mtlname as arn where rn user_falg =1 and rn substring(mtlcode ,1,1)= 'Y' and rn substring(mtlcode ,1,2)>='YL' and rn mtl_class like @mtlcode +'%' rn order by class_name,mtlcode rn endrn rnrnGOrn
这个存储过程该如何修改
目前有同一服务器上两个不同库:db_Web和db_Forun.rnrndb_Web上现有表tbl_stud_info(学生信息)。结构如下:rnStudNO ,ClassNO,StudName等rn表tbl_Class_Info(班级信息).结构如下:rnCLassNO,ClassName,AcadYear --- 学年rnrn当学生毕业时将db_Web库上的表tbl_stud_info属于某个学年的学生信息清除并导入到rn库db_Forun中。rnrnAlter procedure cp_BakTBL_STUD_INFOrn @acadYear intrnasrnrnif exists (select * from db_Forun.dbo.sysobjects where id = object_id(N'[dbo].[TBL_STUD_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)rnbegin rninsert into db_Forun..TBL_STUD_INFO rn select * from TBL_STUD_INFO rn --where b.AcadYear = @acadYearrnwhere rn exists (select * from tbl_stud_info a inner join tbl_class_info b on a.classNO = b.classNO where b.AcadYear = @acadYear) ---筛选出某个学年的学生rn and StudNO not in (select StudNO from db_Forun..TBL_STUD_INFO ) --不重复rnendrnrnelsernselect * into db_Forun..TBL_STUD_INFO from tbl_stud_info rnwhere exists --此处出错?rn (select * from tbl_stud_info a rn inner join tbl_class_info b rn on a.classNO = b.classNO rn where b.AcadYear = @acadYear)rn请问该做如何<em>修改</em>?rn现在我运行该存<em>存储过程</em>它是把所有数据都导入db_Forun中的Tbl_stud_info而不是某一学年的学生数据。请问如何<em>修改</em>?
这个存储过程修改呢?
<em>下面</em><em>这个</em><em>存储过程</em>在保存检查语法都没问题,但当我在查询分析器中运行rnexec sp_vippointmerge 'dserver','database1'(传递参数为服务器名和数据库)rn这时会提示下列错误:rn消息 137,级别 15,状态 2,第 3 行rnMust declare the scalar variable "@vip_totalpoint".rnrn但我确实已经定义了参数@vip_totalpoint了啊,哪位能帮忙看看?rn rnset ANSI_NULLS ONrnset QUOTED_IDENTIFIER ONrngorn rn rn rnALTER proc [dbo].[sp_vippointmerge]rn @servername1 varchar(30),rn @databasename1 varchar(30)rn rnas rn declare @table1 varchar(100)rn declare @vip_scucode_scu varchar(30)rn declare @vip_totalpoint floatrn declare @vip_couponpoint floatrn declare @vip_previouspoint floatrn declare @vip_previouscouponpoint float rn rnbeginrn rnset nocount on; rn rnset @table1=@servername1 + '.' + @databasename1 + '.dbo.vip_vip' rn rnexec ('declare cur_vip_vip cursor for rn select vip_scucode_scu,rn sum(vip_totalpoint)-max(vip_previouspoint) as vip_totalpoint,rn sum(vip_couponpoint)-max(vip_previouscouponpoint) as vip_couponpoint,rn sum(vip_totalpoint)-max(vip_previouspoint) as vip_previouspoint,rn sum(vip_couponpoint)-max(vip_previouscouponpoint) as vip_previouscouponpoint rn fromrn (select vip_scucode_scu,vip_totalpoint,vip_couponpoint,vip_previouspoint,vip_previouscouponpointrn from ' + @table1 + ' rn where vip_totalpoint<>vip_previouspoint or vip_couponpoint<>vip_previouscouponpointrn union allrn select vip_scucode_scu,vip_totalpoint,vip_couponpoint,vip_previouspoint,vip_previouscouponpointrn from vip_vip rn where vip_totalpoint<>vip_previouspoint or vip_couponpoint<>vip_previouscouponpoint) arn group by a.vip_scucode_scurn order by a.vip_scucode_scu')rn rnopen cur_vip_viprnfetch next from cur_vip_vip into rn@vip_scucode_scu,@vip_totalpoint,@vip_couponpoint,@vip_previouspoint,@vip_previouscouponpointrn rnwhile @@fetch_status=0rnbeginrn begin tranrn exec('update ' + @table1 + ' rn set rn vip_totalpoint=@vip_totalpoint,rn vip_couponpoint=@vip_couponpoint,rn vip_previouspoint=@vip_previouspoint,rn vip_previouscouponpoint=@vip_previouscouponpointrn where vip_scucode_scu=@vip_scucode_scu')rn rn update vip_vip rn set rn vip_totalpoint=@vip_totalpoint,rn vip_couponpoint=@vip_couponpoint,rn vip_previouspoint=@vip_previouspoint,rn vip_previouscouponpoint=@vip_previouscouponpointrn where vip_scucode_scu=@vip_scucode_scurn rn IF @@ERROR = 0 rn beginrn commit rn endrn elsern beginrn rollbackrn endrn rnfetch next from cur_vip_vip into rn@vip_scucode_scu,@vip_totalpoint,@vip_couponpoint,@vip_previouspoint,@vip_previouscouponpointrn rnendrn rnclose cur_vip_viprndeallocate cur_vip_viprn rnend
请问下面错误,怎么修改?
一段关于文件读写的程序.rnrnrnrn// IOFileDlg.cpp : 实现文件rn//rnrn#include "stdafx.h"rn#include "IOFile.h"rn#include "IOFileDlg.h"rn#include ".\iofiledlg.h"rnrn#ifdef _DEBUGrn#define new DEBUG_NEWrn#endifrnrnrn// CIOFileDlg 对话框rnrnrnrnCIOFileDlg::CIOFileDlg(CWnd* pParent /*=NULL*/)rn : CDialog(CIOFileDlg::IDD, pParent)rnrn m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);rnrnrnvoid CIOFileDlg::DoDataExchange(CDataExchange* pDX)rnrn CDialog::DoDataExchange(pDX);rnrnrnBEGIN_MESSAGE_MAP(CIOFileDlg, CDialog)rn ON_WM_PAINT()rn ON_WM_QUERYDRAGICON()rn //AFX_MSG_MAPrn rn ON_BN_CLICKED(IDC_Save, OnBnClickedSave)rnrn ON_BN_CLICKED(IDC_Open, OnBnClickedOpen)rnEND_MESSAGE_MAP()rnrnrn// CIOFileDlg 消息处理程序rnrnBOOL CIOFileDlg::OnInitDialog()rnrn CDialog::OnInitDialog();rnrn // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动rn // 执行此操作rn SetIcon(m_hIcon, TRUE); // 设置大图标rn SetIcon(m_hIcon, FALSE); // 设置小图标rnrn // TODO: 在此添加额外的初始化代码rn rn return TRUE; // 除非设置了控件的焦点,否则返回 TRUErnrnrn// 如果向对话框添加最小化按钮,则需要<em>下面</em>的代码rn// 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序,rn// 这将由框架自动完成。rnrnvoid CIOFileDlg::OnPaint() rnrn if (IsIconic())rn rn CPaintDC dc(this); // 用于绘制的设备上下文rnrn SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0);rnrn // 使图标在工作矩形中居中rn int cxIcon = GetSystemMetrics(SM_CXICON);rn int cyIcon = GetSystemMetrics(SM_CYICON);rn CRect rect;rn GetClientRect(&rect);rn int x = (rect.Width() - cxIcon + 1) / 2;rn int y = (rect.Height() - cyIcon + 1) / 2;rnrn // 绘制图标rn dc.DrawIcon(x, y, m_hIcon);rn rn elsern rn CDialog::OnPaint();rn rnrnrn//当用户拖动最小化窗口时系统调用此函数取得光标显示。rnHCURSOR CIOFileDlg::OnQueryDragIcon()rnrn return static_cast(m_hIcon);rnrnrnrnrnvoid CIOFileDlg::OnBnClickedSave()rnrn // MEDIT m_Edit;rn UpdateData(true);rn CStdioFile File;rnrn if(File.Open("a.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeText )==0)rn rn MessageBox("创建文件a.txt失败");rn return;rnrn rnrn File.WriteString (m_Edit);rn File.SetLength (File.GetPosition ());rn File.Close ();rn OpenFile.EnableWindow(true);rn UpdateData(false);rnrn rnrnrnrnrnrnrnvoid CIOFileDlg::OnBnClickedOpen()rnrn WinExec("notepad a.txt",SW_SHOW);rnrnrnd:\exerise\IOFile\IOFileDlg.cpp(106): error C2065: “m_Edit” : 未声明的标识符rnd:\exerise\IOFile\IOFileDlg.cpp(109): error C2228: “.EnableWindow”的左侧必须有类/结构/联合类型rn
下面代码该怎么修改??
private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn if(!Page.IsPostBack)rn rn SqlConnection ct= new SqlConnection("server=localhost;database=oa;uid=sa;pwd=;");rn// SqlDataAdapter cmd=new SqlDataAdapter();rn cmd.SelectCommand=new SqlCommand("select * from 项目",ct);rn SqlCommandBuilder builder = new SqlCommandBuilder(cmd); rn // DataSet dtst=new DataSet();rn cmd.Fill(ds,"项目"); //向数据集装入数据rn DataGrid1.DataSource=ds;rn 向winForm上的dataGrid1装入数据:dataGrid1.SetDataBinding(dataset1,"表名"); rn //向webForm上的dataGrid1装入数据:dataGrid1.DataBind(); rn DataGrid1.DataBind(); rn rn rn rnrn在Page_Load()中用了if(!Page.IsPostBack){}时,运行到<em>下面</em>的代码就要报错,不用时,每点一次页面中的按钮,页面都要刷新一次,该<em>怎么</em>办rnrnTextBox1.Text=ds.Tables [ "项目" ].Rows[DataGrid1.SelectedIndex][0].ToString().Trim();
这个存储过程怎么写?
表A为关键字rnkeywordrn人民rn年轻rn青年rn银行法rn劳动法rn.rn.rn.rn表B有一字段(content),类型为image,里面存放的是二进制格式的文本文件。现在要求:查询表B中包含表A中关键字的全部记录,并求关键字在image字段中的位置(二进制有字节数吧?我不懂)rn是不是要用到游标?rnrn谁能为我解决,500分赠送。注意:B表中Content是二进制格式
这个存储过程怎么
表1:rnrnID 手机号码 地区 rn1 13100009999 1rn2 18900001234 1rn3 13512341234 2rn4 13609875743 2rn5 13709875748 3rn6 18934532234 3rnrn需要[color=#FF0000]按地区[/color]统计出来总用户数rn手机号码为189开头的用户数以及手机号码不为189开头的用户数rnrn结果如下rn[img=http://hi.csdn.net/attachment/201008/10/3101192_1281407667Tpek.jpg][/img]rnrn[color=#FF0000]地区要按编号改成对应城市名 如1=北京 2=上海 3=广州[/color]rnrn<em>这个</em><em>存储过程</em>应该<em>怎么</em>写!
这个存储过程怎么来写?
我现在在前端页面有这样的语句rn。。。。rn rn First Name: rn rn。。。。。rn我想要一个<em>存储过程</em>来把NAME="fname"的值循环加到表里去!rn<em>怎么</em>来做?
这个存储过程怎么写?
建立一个<em>存储过程</em>级联来<em>修改</em>pubs数据库的authors、titleauthor两张表,当用户<em>修改</em>authors表中的au_id后,<em>修改</em>titleauthors表中对应的数据。
怎么这个存储过程
有6张数据表,张三小学1—6年级成绩表,要求写一<em>存储过程</em>,输入某课程名列出该门课的所有成绩
这个存储过程怎么写!
写一个sql储存过程sp_getuser,要求返回表userinfo的所有字段,并把sex字段中的0替rn换为男,1替换为女.
*这个存储过程怎么写?
表1:学校信息Schoolrn---------------------rn编号 名称rn1 ABCrn2 DEFrnrn表二:学校科室Officern----------------------rn编号 学校编号 名称rn1 1 Grn2 1 Hrn3 2 Irnrn表三:学校教师Teacherrn---------------------rn编号 学校编号 教师名称rn1 1 张三rn2 1 李四rn3 2 王五rnrn现在需要统计得到如下结果:rn-----------------------------------------rn学校编号 学校名称 科室数 教师数rn1 ABC 2 2rn2 DEF 1 1rnrnrn<em>这个</em><em>存储过程</em>如何写?
###这个存储过程怎么理解?
select rn rnClassName,Path,HaveBaby,rn LinkURL=case LinkURLrn when '' then ''rn else '[外部链接]'rn end rn,ID from Class order by RootID,OrderIDrnrnrn是表示select ClassName,Path,HaveBaby,LinkURL ,ID from Class order by RootID,OrderIDrn还是表示select ClassName,Path,HaveBaby,“[外部链接]”,ID from Class order by RootID,OrderIDrn呢?rnrn就是LinkURL=case LinkURLrn when '' then ''rn else '[外部链接]'rn end rnrnrn这里不太好理解,谢谢大家帮忙rn
这个存储过程,怎么
exec sp_executesql N'exec Usp_MP_MP04011_total @v_Version,@v_ProjectId, @v_PartId, @v_TbCode',N'@v_Version tinyint,@v_ProjectId int,@v_PartId int,@v_TbCode nvarchar(4)',@v_Version=1,@v_ProjectId=310911,@v_PartId=8351,@v_TbCode=N'TK01'rnrn<em>这个</em>是用友的<em>存储过程</em> ,加密了, 我要写个报表, 我想看<em>这个</em><em>存储过程</em><em>怎么</em>计算的 <em>怎么</em>看啊??
这个存储过程怎么写???
ALTER PROCEDURE [dbo].[p_task]rn @orderID intrn ASrndeclare @c_price decimalrndeclare @c_no varchar(50)rndeclare @c_installer varchar(50)rnBEGINrn update t_task set c_status=8 rn output rn deleted.c_installer,deleted.c_price,deleted.c_no where c_id=@orderID;rnENDrnrnrn<em>这个</em>update语句中通过output返回了c_installer,c_price,c_no三个字段的值,如何把它们赋给declare @c_price decimalrndeclare @c_no varchar(50)rndeclare @c_installer varchar(50)这几个参数?rn
这个存储过程怎么错了?
create procedure sp_getTables rn@count int out rnas rndeclare @id2 int , @id3 int rn-- declare the cursor1rndeclare table2 cursor for select [tid] from table2 rnopen table2 rn-- declare the cursor2rndeclare table3 cursor for select id from table3 rnopen table3rnfetch next from table2 into @id2 rnWHILE @@FETCH_STATUS = 0 rnbegin rn fetch next from table3 into @id3 rn while @@fetch_status = 0 rn begin rn if @id2 = @id3rn @count ++ // 这一行出错rn fetch next from table3 into @id3 rn end rn fetch next from table2 into @id2 rnend rnclose table2 rndeallocate table2 rnclose table3rndeallocate table3rnrn我写的<em>存储过程</em><em>怎么</em>错了阿?
这个存储过程怎么调用```
CREATE PROCEDURE SP_Paginationrn/*rn***************************************************************rn** 千万数量级分页<em>存储过程</em> **rn***************************************************************rn参数说明:rn1.Tables :表名称,视图rn2.PrimaryKey :主关键字rn3.Sort :排序语句,不带Order By 比如:NewsID Desc,OrderRows Ascrn4.CurrentPage :当前页码rn5.PageSize :分页尺寸rn6.Filter :过滤语句,不带Where rn7.Group :Group语句,不带Group Byrn***************************************************************/rn(rn@Tables varchar(1000),rn@PrimaryKey varchar(100),rn@Sort varchar(200) = NULL,rn@CurrentPage int = 1,rn@PageSize int = 10,rn@Fields varchar(1000) = '*',rn@Filter varchar(1000) = NULL,rn@Group varchar(1000) = NULLrn)rnASrn。。。。。。。。。。。。。。。。。。。。。
这个存储过程怎么不执行?
本人pb8,sql2000rn在pb中调用<em>存储过程</em>:insert_jtxh_wh_day_1 如下代码:rnDECLARE jtxh_tj_01 PROCEDURE FOR insert_jtxh_wh_day_1 rn @ls_code = :ls_code1, rn @pb_code = :pb_code1, rn @jd_code = :jd_code1, rn @ttt_date = :ttt_date1, rn @project = :project1, rn @need = :need1, rn @prosition = :prosition1, rn @strength = :strength1, rn @jt_quan = :jt_quan1 ; rn EXECUTE jtxh_tj_01;rn CLOSE jtxh_tj_01;rnrn@ls_code,@pb_code.....已经在<em>存储过程</em>中定义好。rn:ls_code,:pb_code.....已经在pb中取到值。rn经调试,<em>存储过程</em>不执行,不知为啥,高手一看!rn谢谢!(<em>存储过程</em>语法检验通过,比较长就不贴了)
这个存储过程怎么写。
rn有一个表结构如下。ytfwh表rnwhbh, cbh, slrnint char(10) float(8)rnrn以whbh+cbh作为唯一标识rn问题:rn(whbh, cbh, sl)//向<em>存储过程</em>添加的参数。不返回结果rn 1, A0005 10 //或者这条参数是 1, A0005 -10rnrn往ytfwhb表中插入一条上面的<em>这个</em>参数的记录。rn如果在ytfwhb中已经存在这条记录, 就更新这条记录的字段+/-sl. 如果不存在。就添加进去(whbh,cbh,sl)。rnrn
这个存储过程怎么设计???
表:table1rn字段:a1 char rn a2 charrnrn怎样设计下列类似查询的<em>存储过程</em>rnselect a1,a2rnfrom table1rnwhere a1 in ('1','2','3','4')rnrn要求序列'1','2','3','4','5'....为入口参数,并且其个数不定!
这个存储过程怎么调用?!
CREATE PROC P_InsertNewsrnrn@ntitle varchar (30),rn@ncontent varchar (3000),rn@fname varchar (50),rn@fpath varchar (100),rn@fdate datetime,rn@ntype varchar (30)rnrnASrnrnBEGIN TRANrnrnDECLARE @strid intrnDECLARE @num intrnrn SELECT @num=COUNT(*) FROM [T_Type] WHERE T_TypeName=@ntypernrn IF @num=0rn BEGINrn INSERT INTO [T_Type] (T_TypeName) VALUES(@ntype)rn SELECT @strid=ID_Type FROM [T_Type] WHERE T_TypeName=@ntypern ENDrn ELSErn BEGINrn SELECT @strid=ID_Type FROM [T_Type] WHERE T_TypeName=@ntypern ENDrnrn INSERT INTO [T_News] (N_Title,N_Content,N_FileName,N_FilePath,N_Date,N_Type_ID) VALUES(@ntitle,@ncontent,@fname,@fpath,@fdate,@strid)rn rnCOMMIT TRANrnrn数据库有两个表T_News,T_Type,rnT_News的N_Type_ID字段是T_Type的外键rnrn可我<em>怎么</em>调用<em>这个</em><em>存储过程</em>呢?rnrn我写的是:rnmcmd.CommandType=4rn mcmd.CommandText=rn mcmd.Parameters.Append mcmd.CreateParameter(@ntitle,129,1,30,newstitle)rn mcmd.Parameters.Append mcmd.CreateParameter(@ncontent,129,1,3000,strcontent)rn mcmd.Parameters.Append mcmd.CreateParameter(@fname,129,1,50,fname)rn mcmd.Parameters.Append mcmd.CreateParameter(@fpath,129,1,100,fpath)rn mcmd.Parameters.Append mcmd.CreateParameter(@fdate,134,1,,fdate)rn mcmd.Execute rn Set mcmd.ActiveConnection=Nothingrn Set mcmd=Nothingrn rn难道mcmd.CommandText=rn后面要写成两个表名?
怎么调用这个存储过程
<em>存储过程</em>如下:rnREATE PROCEDURE sp_user_loginrn@userid char(16),rn@pwd char(10)rn ASrnselect * from userinfo where userid=@userid and pwd=@pwd and block=0rnrnGOrn调用要求(人家给我的)rnsp_user_loginrn@userid char(16),rn@pwd char(10)rn全部为输入参数,如果输入正确,返回为含有一个用户的表,否则结果为空。rnrn在这里我不知道<em>怎么</em>来 获得它<em>这个</em>返回参数?不知道该<em>怎么</em>调用?rn
这个存储过程怎么调用
有一个<em>存储过程</em>,有2个参数,proc_add(a int,b int),想从一个表里读出a,b然后用proc_add来处理,该<em>怎么</em>写?我想用call proc_add(select a,b from table) 报错。。。。请指点
这个存储过程怎么优化?
ALTER PROC dbo.proc_MovePost @dt_begin datetimernASrnDECLARE @dt_end datetime,rn@tbname sysname,rn@s nvarchar(4000)rnSELECT rn@dt_end = DATEADD(Month, 1, @dt_begin),rn@tbname = QUOTENAME('post_' + CONVERT(char(6), @dt_begin, 112))rnrnselect * into #temp_MovePost from post rnwhere dateofpost>=@dt_begin and dateofpost, @dt_begin , @dt_end rnrnrnGO
从51到ARM32位嵌入式系统入门 part3下载
前面已经作了介绍,不再赘述,继续上传。part0~part3全部下载完毕后,通过“合并从51到ARM32位嵌入式系统入门.rar.bat”文件来合并这几个文件 相关下载链接:[url=//download.csdn.net/download/CXS8826/2619786?utm_source=bbsseo]//download.csdn.net/download/CXS8826/2619786?utm_source=bbsseo[/url]
接口课件 8255芯片下载
这个是接口的一部分课件,8255的 我在一个大学的网站上下载到的,希望对你有用 相关下载链接:[url=//download.csdn.net/download/daisy_2011/4006481?utm_source=bbsseo]//download.csdn.net/download/daisy_2011/4006481?utm_source=bbsseo[/url]
无线传感器远程代码更新系统下载
基于传感器网络的传感器能耗降低着手,远程代码更新机制,论述了移除沉余资料,降低能耗 相关下载链接:[url=//download.csdn.net/download/longtiegang/4222547?utm_source=bbsseo]//download.csdn.net/download/longtiegang/4222547?utm_source=bbsseo[/url]
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法
我们是很有底线的