Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > MS SQL Server
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 06-10-2005
Avatar de Chente(rMan)
Chente(rMan) Chente(rMan) is offline
Miembro
 
Registrado: ago 2005
Posts: 89
Poder: 21
Chente(rMan) Va por buen camino
Que tal kikodelphi, y que te parece si lo haces de esta manera.

Código SQL [-]
CREATE PROCEDURE GrabaComprVta @IDCliente Int, .... , @Er int output AS
BEGIN TRAN
declare @error int
Select @IDCompr = MAX(IDComprobante) from Comprobante 
///////////
/////// insert .......
///////
 
set @error = @@error

IF @ERROR = 0
   begin
      COMMIT
      select 'Correcto' as description
   end
else
   begin
      rollback
      select description from master.dbo.sysmessages where error = @error
   end
GO


Espero te sea de utilidad.



Saludos.

Vicente López.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:42:35.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi