title: How to update column in SQL Server 2008
body: <p>I'm new to SQL Server so any help with this would be greatly appreciated. I can not find the error while update the existing column with autogenerated record</p>
  
  <p>Here is my table structure:-</p>
  
  <pre><code>CREATE TABLE [dbo].[EmployeeRegistration]
  (
      [ID] [int] NULL,
      [Sr_no] [int] IDENTITY(1,1) NOT NULL,
      [Branch_Code] [varchar](200) NULL,
      [City] [varchar](200) NULL,
      [Employee_Name] [varchar](200) NULL,
      [Designation] [varchar](200) NULL,
      [Department] [varchar](200) NULL,
      [Date_of_Joining] [varchar](200) NULL,
      [Reporting_To] [varchar](200) NULL,
      [Staff_Code] [varchar](50) NULL,
      [Reporting_To_1] [varchar](200) NULL,
      [Staff_Code_1] [varchar](50) NULL,
      [Emp_Staff_Code]  AS ('T'+right('0000'+CONVERT([varchar](8),[Sr_no],(0)),(8))),
      [Password] [varchar](50) NULL,
      [confirmPassword] [varchar](50) NULL,
      [EMAIL_id] [varchar](50) NULL,
      [IsActive] [varchar](200) NULL,
      [Created_By] [varchar](200) NULL,
      [Created_On] [date] NOT NULL,
      [Modified_By] [varchar](200) NULL,
      [Modified_Date] [date] NOT NULL
  )
  </code></pre>
  
  <p>I want to update <code>Password</code> column with below query:-</p>
  
  <pre><code>use AxpressDB 
  
  alter table EmployeeRegistration 
     alter column Password AS ('XP'+right('0123'+CONVERT([varchar](50),[Sr_no],(0)),(8)))
  </code></pre>