duplicated data changing on field

  • I know there has to be a way to do it however I just can't get it I have a table that has a time field that ticks from 0:00 all the way up to 23:50 in 10 minute incraments there is a field in there that is a 0 I need to duplicate all rows changing that field to a 1 any help on this would be appreciated

     

    CREATE TABLE [dbo].[csr_schedule] (

     [schedule_id] [bigint] IDENTITY (1, 1) NOT NULL ,

     [break_time] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

     [type] [bit] NOT NULL ,

     [branch_id] [int] NOT NULL

    ) ON [PRIMARY]

     

     

    type is the field that I need to change

  • By duplicating, I assume you mean to copy/reinsert all rows >>

    Insert into dbo.crs_schedule (break_time, type, branch_id)

    Select break_time, 1 as type, branch_id from dbo.crs_schedule

    otherwise you just need a simple update statement.

  • thank you for the prompt reply I will try that - thanks again

  • HTH.

Viewing 4 posts - 1 through 3 (of 3 total)

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