PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > SQL Server Transaction block
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SQL Server Transaction block

Réponse
 
LinkBack Outils de la discussion
Vieux 10/09/2008, 09h10   #1
Venkatesh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SQL Server Transaction block

Hi,

I have a main SP that is scheduled using SQL Agent. This SP calls other SPs
in a transaction block. The other SPs just inserts data into NBIFeed table.
Code is

Create Procedure SP_Main
As
Declare @Ret1, @Ret2, @Ret3 as integer

Begin Transaction T1

exec @Ret1 = SP_NBIFeed1
exec @Ret2 = SP_NBIFeed2
exec @Ret3 = SP_NBIFeed3

If @Ret1 = 0 and @Ret2 = 0 and @Ret3 = 0
Commit Transaction T1
else
Rollback Transaction T1

The SP_NBIFeed SPs just inserts data into NBIFeed table from other source
tables (simple insert query) and returns @@error to main SP.

The question is, why all SPs are not inserting data if it is scheduled? If
SP_Main is executed in query analyser, all SPs are inserting data. This is
happening in SQL 2000.
  Réponse avec citation
Vieux 10/09/2008, 09h56   #2
Uri Dimant
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQL Server Transaction block

Hi
Have run SQL Server Profiler to see what is going on?


"Venkatesh" <Venkatesh@discussions.microsoft.com> wrote in message
news:21798B67-B5A0-4AEC-B1D9-B6055F2BB197@microsoft.com...
> Hi,
>
> I have a main SP that is scheduled using SQL Agent. This SP calls other
> SPs
> in a transaction block. The other SPs just inserts data into NBIFeed
> table.
> Code is
>
> Create Procedure SP_Main
> As
> Declare @Ret1, @Ret2, @Ret3 as integer
>
> Begin Transaction T1
>
> exec @Ret1 = SP_NBIFeed1
> exec @Ret2 = SP_NBIFeed2
> exec @Ret3 = SP_NBIFeed3
>
> If @Ret1 = 0 and @Ret2 = 0 and @Ret3 = 0
> Commit Transaction T1
> else
> Rollback Transaction T1
>
> The SP_NBIFeed SPs just inserts data into NBIFeed table from other source
> tables (simple insert query) and returns @@error to main SP.
>
> The question is, why all SPs are not inserting data if it is scheduled? If
> SP_Main is executed in query analyser, all SPs are inserting data. This is
> happening in SQL 2000.



  Réponse avec citation
Vieux 10/09/2008, 10h11   #3
Venkatesh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQL Server Transaction block

I have limited access and can't use SQL profiler on prod server. I wrote the
code to log and all these SPs are getting called and returning 0. I guess the
code was working earlier and I just added one more sp say SP_NBIFeed3, which
is not inserting additional records.


"Uri Dimant" wrote:

> Hi
> Have run SQL Server Profiler to see what is going on?
>
>
> "Venkatesh" <Venkatesh@discussions.microsoft.com> wrote in message
> news:21798B67-B5A0-4AEC-B1D9-B6055F2BB197@microsoft.com...
> > Hi,
> >
> > I have a main SP that is scheduled using SQL Agent. This SP calls other
> > SPs
> > in a transaction block. The other SPs just inserts data into NBIFeed
> > table.
> > Code is
> >
> > Create Procedure SP_Main
> > As
> > Declare @Ret1, @Ret2, @Ret3 as integer
> >
> > Begin Transaction T1
> >
> > exec @Ret1 = SP_NBIFeed1
> > exec @Ret2 = SP_NBIFeed2
> > exec @Ret3 = SP_NBIFeed3
> >
> > If @Ret1 = 0 and @Ret2 = 0 and @Ret3 = 0
> > Commit Transaction T1
> > else
> > Rollback Transaction T1
> >
> > The SP_NBIFeed SPs just inserts data into NBIFeed table from other source
> > tables (simple insert query) and returns @@error to main SP.
> >
> > The question is, why all SPs are not inserting data if it is scheduled? If
> > SP_Main is executed in query analyser, all SPs are inserting data. This is
> > happening in SQL 2000.

>
>
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 06h09.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08179 seconds with 11 queries