CREATE PROCEDURE pp @c_id char(10),@cols int output --Output,不是out AS Begin select * from AA where id=@c_id select @cols=@@RowCount --@@Rowcount ,不是@@identity End GO--执行 Declare @cols Int EXEC pp 1,@cols Output Select @cols
7. @@ROWCOUNT 说明:返回受上一语句影响的行数。语法:@@ROWCOUNT返回类型:integer注释:任何不返回行的语句将这一变量设置为 0 ,如 IF 语句。示例:下面的示例执行 UPDATE 语句并用 @@ROWCOUNT 来检测是否有发生更改的行。 UPDATE authors SET au_lname = 'Jones' WHERE au_id = '999-888-7777' IF @@ROWCOUNT = 0 print 'Warning: No rows were updated'
CREATE PROCEDURE pp @c_id char(10),@cols int output --Output,不是out
AS
Begin
select * from AA where id=@c_id
select @cols=@@RowCount --@@Rowcount ,不是@@identity
End
GO--执行
Declare @cols Int
EXEC pp 1,@cols Output
Select @cols
说明:返回受上一语句影响的行数。语法:@@ROWCOUNT返回类型:integer注释:任何不返回行的语句将这一变量设置为 0 ,如 IF 语句。示例:下面的示例执行 UPDATE 语句并用 @@ROWCOUNT 来检测是否有发生更改的行。 UPDATE authors SET au_lname = 'Jones'
WHERE au_id = '999-888-7777'
IF @@ROWCOUNT = 0
print 'Warning: No rows were updated'
@@identity和=@@RowCount
是什么意思这是SQL的属性吗?有没有人给我解释一下?