–首次看到ROWCOUNT的用法
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[aa]’) and OBJECTPROPERTY(id, N’IsProcedure’) = 1)
drop procedure [dbo].[aa]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE procedure dbo.aa
(
@aa nvarchar(20) ,
@bb nvarchar(20),
@cc int
)
as
declare @SqlString as nvarchar(1000)
begin
set @SqlString=’select top ‘+ @bb+ ‘ * from ( Select top ‘ +@aa +’ * from Application order by applicationID ) v order by ID’
SET ROWCOUNT @cc
execute sp_executesql @SqlString
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
今天的文章RowCount_10count下滑[通俗易懂]分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/69732.html