Deadlock with read and update a simple table

  • I try to store a last document number for each deparment in a table

     

    CREATE TABLE [LastDoc] (

     [Department] [int] NOT NULL ,

     [LastNum] [int] NULL CONSTRAINT [DF_LastDoc_LastNum] DEFAULT (0),

     CONSTRAINT [PK_LastDoc] PRIMARY KEY  CLUSTERED

     (

      [Deparment]

    &nbsp  ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    I create a store procedure to update the last number, This is a simplex example of my procedure

     

     

     

  • First, please pay attention to where you are posting. This forum title is 'Anything That Is Not About SQL Server'. Notice the NOT........

    Second, you don't post a problem/question. What do you want to know?

    I suggest posting your question in an appropriate forum.

    -SQLBill

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply