Duplicate sales invoice numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Merchant62
    New Member
    • Apr 2014
    • 1

    Duplicate sales invoice numbers

    I have multiple user environment and want to obtain uniq sales invoice no for each user
    I run update query
    Code:
    ALTER PROCEDURE [dbo].[A_refupdate]
    	-- Add the parameters for the stored procedure here
    	@gid varchar(5)
    AS
    UPDATE [SSENTP2].[dbo].[TB_KEY_CONTROL]
        WITH (ROWLOCK) SET COUNTERS =COUNTERS+.000001
       
    UPDATE [SSENTP2].[dbo].[TB_KEY_CONTROL]
       WITH (ROWLOCK) SET	voucher=INITIALS+SUBSTRing(STR(COUNTERS,8,7),3,7) 
    	 WHERE KEY_ID=@gid
    It is not allotting unique invoice number to the users

    i will be very thank full if any one guide me to right way
    Last edited by Rabbit; Apr 14 '14, 03:39 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    We can't help unless we know the table definitions.

    Comment

    Working...