There was an error importing the database. The status of the import is unknown.'×' 附近有语法错误。在本机存储过程脚本可以使用,上传到数据库服务器报上面的错误MS SQL存储数据库服务器脚本

解决方案 »

  1.   

    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_page]') AND type in (N'P', N'PC'))
    BEGIN
    EXEC dbo.sp_executesql @statement = N'
    CREATE  procedure [dbo].[sp_page]
    @sqlstr nvarchar(4000), --查询字符串
    @currentpage int, --第N页
    @pagesize int --每页行数
    as
    set nocount on
    declare @P1 int, --P1是游标的id
     @rowcount int
    exec sp_cursoropen @P1 output,@sqlstr,@scrollopt=1,@ccopt=1,@rowcount=@rowcount output
    select @rowcount as 总行数--, ceiling(1.0*@rowcount/@pagesize) as 总页数,@currentpage as 当前页 
    set @currentpage=(@currentpage-1)*@pagesize+1
    exec sp_cursorfetch @P1,16,@currentpage,@pagesize 
    exec sp_cursorclose @P1
    set nocount off--exec [sp_page]''select  *  from shopinfo inner join userinfo on userinfo.username = shopinfo.username  where userinfo.user_type=''''企业'''' order by userinfo.id asc'',1,20

    END上面是存储过程
      

  2.   

    数据库服务器该不会是SQL2000吧?