none
How to alter table with computed column

    Question

  • I have a table with computed column

    CREATE TABLE XXXX(
    [DATE_VAL] [varchar](50) NULL,
    [DATE] AS (case when isdate([DATE_VAL])=(1) then CONVERT([datetime],[DATE_VAL])
    when isdate('20'+substring([DATE_VAL],(3),len([DATE_VAL])-(2)))=(1) then CONVERT([datetime],'20'+substring([DATE_VAL],(3),len([DATE_VAL])-(2)))  end)


    i need to alter the computed column by removing the second case expression
    do i need to drop the computed column and recreate or can i alter the same computed column
    [DATE]  AS (case when isdate([DATE_VAL])=(1) then CONVERT([datetime],[DATE_VAL])

    Monday, August 25, 2014 9:21 PM

Answers