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

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 什么都不知道

DataSet的Xml序列化问题 VB.NET的一个小问题 Access is denied的问题 - 什么都不知道 SQL Server的效率? datagrid刷新问题 使用Visio DrawingControl的应用开发(补) 突起效果的Label WinForm下TextBox的数据绑定和更新 使用Radio按钮选择DataGrid行 如何在运行时加载不处于应用程序目录下的assembly 使用VSA给程序加上脚本支持 删除所有Windows组件 在ASP.NET中嵌入wml标记 c#中动态装载dll 处理大型xml文件 RedirectToMobilePage的问题 使用Visio 2003 Drawing Control开发应用(3)(4) 使用Visio 2003 Drawing Control开发应用(2) 使用Visio 2003 Drawing Control开发应用(1)
存储过程output参数问题
什么都不知道 · 2005-01-14 · via 博客园 - 什么都不知道

下面的存储过程,ID1是同时作为输入输出参数的。

CREATE Procedure usp_test
 @ID1 int output,
 @ID int
AS

IF @ID1 = 0
BEGIN
 SELECT * FROM Customers
 SET @ID1 = 1
 end
ELSE
begin
 SELECT Employees.* FROM Employees
 SET @ID1 = 2
end
GO


通过查询分析器直接运行还是通过VS.NET都能正常运行,可是当用ado.net写一个程序调用时,就不一样了。设置ID1这个参数等于0根本没有用,从Profiler来看,ID1一上来就是1,IF那部分不会执行下去。
不过,如果将两个参数调整一下位置就可以了
CREATE Procedure usp_test
 @ID int,
 @ID1 int output
AS .....
有些奇怪,因无从下手找KB,不知道这个是不是ADO.NET的问题,还是其他问题

(1-15更新)

问题好像不是那么简单,今天无论调整成怎样都不行。后来又好了,但是不关次序的问题,而是与设置ParameterDirection.InputOutput还是ParameterDirection.Output有关。而且发现当是ParameterDirectioin.Output的时候,参数设置什么都没有用,都是NULL,存储过程改称

IF @ID1 = 0  OR @ID1 is NULL

就可以了

不过,即使设置了ID1=1也执行不了ELSE的内容,奇怪的问题。