国外的数据库存储过程

johnbl 2007-08-18 12:47:50
国外主机Godaddy,我在上面建了一个用于分页的存储过程.那个存储过程在我本地和国内的服务器上都能正常运行,但是在Godaddy上不能取到数据.问了Godaddy回答的也很含糊,让我自己去看帮助.
...全文
198 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
在路上_- 2007-08-19
  • 打赏
  • 举报
回复
把中文注释去掉试试,去掉所有中文字符
lang8134 2007-08-19
  • 打赏
  • 举报
回复
但是在Godaddy上不能取到数据
-----------------------------
既然国内都可以,那么上面这句我不相信,LZ远程看看吧。
johnbl 2007-08-19
  • 打赏
  • 举报
回复
xxzxwsx()
非常感谢
确实是由于注释造成的
declare @strSQL varchar(5000) -- ???
把注释去掉以后就可以了~
johnbl 2007-08-19
  • 打赏
  • 举报
回复
但是在Godaddy上不能取到数据
-----------------------------
既然国内都可以,那么上面这句我不相信,LZ远程看看吧。
____________________________________________________
国外服务器的设置和国内是不一样的
很多在国内能用的东西,在国外不一定能用,国外服务器的信任级别设的比国内要低
但是我感觉存储过程应该没有什么限制才对
昵称被占用了 2007-08-18
  • 打赏
  • 举报
回复
信息不足

首先你应该确定存储过程是否已经建立
其次确定的存储过程中没有用到你不够权限的语句
johnbl 2007-08-18
  • 打赏
  • 举报
回复
存储过程在服务器上已经创建成功了~
存储过程如下:
CREATE procedure [dbo].[SP_Paging_My]
(
@tblName VarChar(2000),
@pagesize int,
@pageindex int,
@docount bit,
@key VarChar(50),
@order VarChar(100)
)
as
declare @strSQL varchar(5000) -- ???
set nocount on
if(@docount!=0)
set @strSQL = 'select count(' + @key + ') from ' + @tblName
else
begin
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
create table #pageindex(id int identity(1,1) not null,nid int)
set rowcount @PageUpperBound
set @strSQL = 'insert into #pageindex(nid) select ' + @key + ' from '+ @tblName + ' order by ' + @order
exec (@strSQL)
set @strSQL = 'select tmp.* from ' + @tblName +',#pageindex p where tmp.' + @key + '=p.nid and p.id>' + str(@PageLowerBound) +' and p.id<=' + str(@PageUpperBound)

end
--将选出的结果放到临时表中
--exec ('insert into test(result) values ('''+ @strSQL + ''')')
exec (@strSQL)
set nocount off

GO
gxqianqin 2007-08-18
  • 打赏
  • 举报
回复
同意LS

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧