首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

在ms sqlserver2000中分页存储过程解决思路

2012-03-12 
在ms sqlserver2000中分页存储过程想实现 select top n * from from ShopCompany where flat推荐会员的

在ms sqlserver2000中分页存储过程
想实现 select top n * from from ShopCompany where flat='推荐会员'的存储过程

create procedure pro_BindData
@page_size int 
as
select top @page_size * from ShopCompany where flat='推荐会员'
go

却报错
第 4 行: '@page_size' 附近有语法错误。
哪位给解答一一下,谢谢了,

[解决办法]
把select top @page_size * from ShopCompany where flat='推荐会员' 改称
Exec('select top '+@page_size+' * from ShopCompany where flat=''推荐会员''')
 

热点排行