IF COL_LENGTH('dbo.asr_bas_devp', 'in_first_crn_csv') IS NULL
BEGIN
    ALTER TABLE [dbo].[asr_bas_devp]
        ADD [in_first_crn_csv] VARCHAR(255) NULL,
            [in_second_crn_csv] VARCHAR(255) NULL,
            [in_first_crn_current_no] INT NULL,
            [in_second_crn_current_no] INT NULL;
END;

IF NOT EXISTS (
    SELECT 1
    FROM sys.extended_properties
    WHERE major_id = OBJECT_ID(N'dbo.asr_bas_devp')
      AND name = N'MS_Description'
)
BEGIN
    EXEC sys.sp_addextendedproperty
        @name = N'MS_Description',
        @value = N'站点基础信息表',
        @level0type = N'SCHEMA',
        @level0name = N'dbo',
        @level1type = N'TABLE',
        @level1name = N'asr_bas_devp';
END;

IF NOT EXISTS (
    SELECT 1
    FROM sys.extended_properties
    WHERE major_id = OBJECT_ID(N'dbo.asr_bas_devp')
      AND minor_id = COLUMNPROPERTY(OBJECT_ID(N'dbo.asr_bas_devp'), N'in_first_crn_csv', 'ColumnId')
      AND name = N'MS_Description'
)
BEGIN
    EXEC sys.sp_addextendedproperty
        @name = N'MS_Description',
        @value = N'入库第一优先堆垛机，CSV',
        @level0type = N'SCHEMA',
        @level0name = N'dbo',
        @level1type = N'TABLE',
        @level1name = N'asr_bas_devp',
        @level2type = N'COLUMN',
        @level2name = N'in_first_crn_csv';
END;

IF NOT EXISTS (
    SELECT 1
    FROM sys.extended_properties
    WHERE major_id = OBJECT_ID(N'dbo.asr_bas_devp')
      AND minor_id = COLUMNPROPERTY(OBJECT_ID(N'dbo.asr_bas_devp'), N'in_second_crn_csv', 'ColumnId')
      AND name = N'MS_Description'
)
BEGIN
    EXEC sys.sp_addextendedproperty
        @name = N'MS_Description',
        @value = N'入库第二优先堆垛机，CSV',
        @level0type = N'SCHEMA',
        @level0name = N'dbo',
        @level1type = N'TABLE',
        @level1name = N'asr_bas_devp',
        @level2type = N'COLUMN',
        @level2name = N'in_second_crn_csv';
END;

IF NOT EXISTS (
    SELECT 1
    FROM sys.extended_properties
    WHERE major_id = OBJECT_ID(N'dbo.asr_bas_devp')
      AND minor_id = COLUMNPROPERTY(OBJECT_ID(N'dbo.asr_bas_devp'), N'in_first_crn_current_no', 'ColumnId')
      AND name = N'MS_Description'
)
BEGIN
    EXEC sys.sp_addextendedproperty
        @name = N'MS_Description',
        @value = N'入库第一优先池当前堆垛机号',
        @level0type = N'SCHEMA',
        @level0name = N'dbo',
        @level1type = N'TABLE',
        @level1name = N'asr_bas_devp',
        @level2type = N'COLUMN',
        @level2name = N'in_first_crn_current_no';
END;

IF NOT EXISTS (
    SELECT 1
    FROM sys.extended_properties
    WHERE major_id = OBJECT_ID(N'dbo.asr_bas_devp')
      AND minor_id = COLUMNPROPERTY(OBJECT_ID(N'dbo.asr_bas_devp'), N'in_second_crn_current_no', 'ColumnId')
      AND name = N'MS_Description'
)
BEGIN
    EXEC sys.sp_addextendedproperty
        @name = N'MS_Description',
        @value = N'入库第二优先池当前堆垛机号',
        @level0type = N'SCHEMA',
        @level0name = N'dbo',
        @level1type = N'TABLE',
        @level1name = N'asr_bas_devp',
        @level2type = N'COLUMN',
        @level2name = N'in_second_crn_current_no';
END;
