惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 黄永泰

extern修饰符的使用(C#) .NET Framework 4与.NET Framework 4 Client Profile 的区别? 《C#与.NET 4高级程序设计:第5版》这本书如何? *.docx文件打开方法 试图运行项目时出错,无法启动调试。没有正确安装调试器,请运行安装程序安装或恢复调试器。 System.ArgumentException: 另一个SqlParameterCollection中已包含SqlParameter。 买了几本书。 给Visual Studio 2010换皮肤。 请教一个程序自动升级的写法. 支持掘金,支持"甜瓜"安东尼. NBA 2009-10赛季赛程表 IList<T>、List<T>、BindingList<T>与dataGridView的绑定问题(请教)。 IList<T>、List<T>、BindingList<T>与dataGridView的绑定问题。 近期及今后一段时间的学习目标. 请教: sql server 中动态创建命令语句 大家继续努力! 近期.net学习计划。 谢谢大家的指教! - 黄永泰 关于“我的藏书阁:.NET/数据库应用开发”的几点看法。 - 黄永泰
数据库从Sql server 2000升级到2005后,遇到一点问题。
黄永泰 · 2008-12-02 · via 博客园 - 黄永泰

不知哪位碰到这样的问题,请知道的朋友指数,谢谢!

我的数据库用的是sql server 2000,升级之前一切正常,但升级到2005后,一个存在过程在被调用运行的过程中出现了问题,而且是隔几天又没事,隔几天又出现问题,反反复复,真的奇怪。不行的时候提示的信息如下(在.net 2003和2008中都如此) 

“超时时间已到。在操作完成之前超时时间已过或服务器未响应。”

但把该存储过程的代码弄在查询窗口中运行又不会出现问题,真的是百思不得其解。

不知道是否.net代码在调用sql server 2005存储过程是不时要进行其它的处理,请知道的朋友指教,谢谢。存储过程的代码如下:

ALTER PROCEDURE dbo.JIT_Sha_Dairy_RptTemp_UseInRpt03_1

@dt1 as datetime,
@dt2 as datetime,
@CCode char(4)--,

AS

declare @weight_浅色 decimal(12,2)
declare @weight_中色 decimal(12,2)
declare @weight_深色 decimal(12,2)
declare @weight_漂白白色 decimal(12,2)

set @weight_浅色 = 0
set @weight_中色 = 0
set @weight_深色 = 0
set @weight_漂白白色 = 0

declare @WeightTable table
(
 weight_浅色 decimal(17,4),
 weight_中色 decimal(17,4),
 weight_深色 decimal(17,4),
 weight_漂白白色 decimal(17,4)
)

declare @dairyTable table
(
 客户编号 char(4),
 缸号 char(18),
 百分比总和 decimal(12,4),
 产量 decimal(12,2)
)

--以下统计染色
insert into @dairyTable
select
 d.CCode as 客户编号,
 b.Job_No as 缸号,
 sum(a.Baifenbi) as 百分比总和,
 avg(c.Weight_Dairy) as 产量
from Sha_Piaorandan1 a left outer join Sha_Piaorandan b
 on a.Piaoran_No = b.Piaoran_No
left outer join Sha_Paigang c on b.Job_No = c.Job_No
left outer join Contract_Total d on c.Cont_No = d.Cont_No
where
 c.Finish = 'Y'
 and c.Prod_Date between @dt1 and @dt2
 and a.RCode not like 'C%'
 and a.RCode <> ''
 and b.Piaoran_Type not in ('YBC','YBS') --漂白/YBC,半漂/YBS不参加进去,假设该单不领染料
group by d.CCode,b.Job_No

if @CCode <> ''
 delete @dairyTable where 客户编号 <> @CCode

  select @weight_浅色 = sum(产量) * 0.9 from @dairyTable where 百分比总和 <= 1.5

select @weight_中色 = sum(产量) * 1 from @dairyTable where 百分比总和 > 1.5 and 百分比总和 <= 3.5

select @weight_深色 = sum(产量) * 1.35 from @dairyTable where 百分比总和 > 3.5

--以下统计漂白/YBC,半漂YBS
--先把之前的资料删除
delete @dairyTable

insert into @dairyTable
select
 d.CCode as 客户编号,
 b.Job_No as 缸号,
 sum(a.Baifenbi) as 百分比总和,
 avg(c.Weight_Dairy) as 产量
from Sha_Piaorandan1 a left outer join Sha_Piaorandan b
 on a.Piaoran_No = b.Piaoran_No
left outer join Sha_Paigang c on b.Job_No = c.Job_No
left outer join Contract_Total d on c.Cont_No = d.Cont_No
where
 c.Finish = 'Y'
 and c.Prod_Date between @dt1 and @dt2
 and b.Piaoran_Type in ('YBC','YBS') --漂白/YBC,半漂/YBS
group by d.CCode,b.Job_No

if @CCode <> ''
 delete @dairyTable where 客户编号 <> @CCode

  select @weight_漂白白色 = sum(产量) * 0.6 from @dairyTable

insert into @WeightTable values(@weight_浅色, @weight_中色 , @weight_深色, @weight_漂白白色)

select * from @WeightTable