Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incrementing folio problem
Message
De
30/05/2013 11:47:07
Mike Yearwood
Toronto, Ontario, Canada
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01575144
Message ID:
01575147
Vues:
64
>>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
>
>Why you're not using identity column?

In another recent thread, a person got angry because he disliked experts not answering the original question. Show him how to use what he is trying to use and don't tell him what not to do.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform