Welcome to Sign in | Help

Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)

  •  01-31-2008, 2:59 PM

    Re: Internal SQL Server error. (Server: Msg 8624, Level 16, State 21, Line 29)

    La mine a mers. Adică am reuşit să reproduc fenomenul, obţinând eroarea respectivă folosind query-ul tău şi următoarele tabele:

    create table debite_pf (
        id_tipdebit int,
        suma money,
        id_matr uniqueidentifier,
        id_tipmatr int,
        id_rol int,
        an int
    )

    create table roluri_fiz (
        id int,
        id_prim uniqueidentifier
    )

    Iar apoi am încercat următorul query, care nu a mai dat eroare:


     select distinct dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr) as grup,
      dbf.an,
      coalesce(
       (select sum(suma)from debite_pf p
       where  
        p.id_tipdebit = 2
        and p.an = dbf.an
        and  dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)
         =
         dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)
       ),0) as ramasite,
      coalesce(
       (select sum(suma)from debite_pf p
       where  
        (p.id_tipdebit = 5 or p.id_tipdebit = 8)
        and p.an = dbf.an
        and  dbo.GetGrupareByIDTipMatricola(dbf.id_tipmatr,dbf.id_matr)
         =
         dbo.GetGrupareByIDTipMatricola(p.id_tipmatr,p.id_matr)
       ),0) as accesorii
     from   roluri_fiz r
     inner join  debite_pf dbf
       on r.id = dbf.id_rol
     where  r.id_prim = @idprim and
      dbf.id_tipdebit in (2,5,8)
      and dbf.an <= year(@dataCurenta)

    Răzvan
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems