Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incrementing folio problem
Message
De
30/05/2013 11:34:36
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Incrementing folio problem
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01575144
Message ID:
01575144
Vues:
82
Hi,

We have a folio (unique number) which needs to be incremented by one every time a user needs it.
The problem is that SQL Servers seems to hung and never returns the incremented number. This happens when we have concurrency of several users.

The code is the following:
USE [Cal_hon_Desa]
GO
/****** Object:  StoredProcedure [dbo].[Sel_Trae_Folio_ICS]    Script Date: 05/30/2013 09:34:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


-- =============================================
-- Author:        xxxxx
-- Create date: 11-01-2012
-- Description:   Selecciona los datos de operacion a calcular
-- =============================================
ALTER PROCEDURE [dbo].[Sel_Trae_Folio_ICS]

AS
BEGIN
      Select Folio_TB_ics from PRM_Folios
            UPDATE dbo.PRM_Folios
      SET Folio_TB_ICS = Folio_TB_ics + 1
END
Any ideas on how to make this code better or what we are doing wrong?

Thanks,
Daniel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform