Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    23

    Unanswered: Migrating Sybase to SQL Server 2000

    Hi all

    I try to migrate sybase to SQL Server 2000, but found a los of trouble, please, some can help me to resolve this???

    May many of that are easy to resolv, but is mi fist time with SQL Server 2000... plz, help

    Object : Procedure
    Error : Sintaxis incorrecta cerca de la palabra clave 'cursor'.
    Code :

    Create Procedure ABA_CenResul
    as
    Begin
    declare @EST_CEN_Codigo char(8),
    @EST_CEN_Descripcio char(100),
    @n char(100),
    @name char(100),
    @salida char(8),
    @vble int,
    @ini int,
    @ter int,
    @indice int,
    @aux_descripcion char(100)
    declare sonido cursor
    for
    select EST_CEN_Codigo, EST_CEN_Descripcio
    from EST_CenResul
    open sonido
    fetch sonido into @EST_CEN_Codigo,@EST_CEN_Descripcio
    select @EST_CEN_Descripcio = @EST_CEN_Descripcio + " "
    select @aux_descripcion = @EST_CEN_Descripcio
    while @@sqlstatus !=2
    begin
    select @indice = 1
    while @indice <> 4
    begin
    select @vble = patindex("% %",@EST_CEN_Descripcio)
    select @ter = @vble - 1
    select @name = substring(@EST_CEN_Descripcio,1,@ter)
    if @indice = 1
    select @n = @name
    else
    select @n = @n + "/" + @name

    select @ini = @vble + 1
    select @EST_CEN_Descripcio = substring(@EST_CEN_Descripcio,@ini,100)
    select @indice = @indice + 1
    end
    print @n
    exec sdxsrvr...soundex @n, @salida out
    update EST_CenResul
    set EST_CEN_Soundex = @salida
    where EST_CEN_Codigo = @EST_CEN_Codigo
    fetch sonido into @EST_CEN_Codigo, @EST_CEN_Descripcio
    -- select @EST_CEN_Descripcio = @EST_CEN_Descripcio + " "
    -- select @aux_descripcion = @EST_CEN_Descripcio
    end
    close sonido
    deallocate cursor sonido
    end
    Thnx in advance
    There's only 10 kinds of people: the ones who know binary and the ones who doesn't

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    try @@FETCH_STATUS != -1 instead of @@SQLSTATUS != 2
    and
    just deallocate sonido
    instead of
    deallocate cursor sonido
    Last edited by PMASchmed; 02-25-08 at 12:16.

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    The DEALLOCATE statement does not need the CURSOR keyword. You can take it out, and see if that is the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •