Advertisement
hecrus

as comments new 4 fields

Nov 21st, 2021
1,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.08 KB | None | 0 0
  1. -- Проверка поля guid uniqueidentifier:-- @tmp_NULLABLE: 1 @strNULLABLE:  NULL
  2. -- @tmp_PRECISION: 0,  @tmp_SCALE: 0,  @tmp_RADIX: -1
  3. IF COL_LENGTH( 'as_comments', 'guid') IS NULL
  4.    BEGIN
  5.    ALTER TABLE as_comments
  6.    ADD [guid] uniqueidentifier (max) NULL  
  7. END
  8. -- Проверка поля hasCheck bit:-- @tmp_NULLABLE: 1 @strNULLABLE:  NULL
  9. -- @tmp_PRECISION: 0,  @tmp_SCALE: 0,  @tmp_RADIX: -1
  10. IF COL_LENGTH( 'as_comments', 'hasCheck') IS NULL
  11.    BEGIN
  12.    ALTER TABLE as_comments
  13.    ADD [hasCheck] bit NULL  
  14. END
  15. -- Проверка поля checked datetime:-- @tmp_NULLABLE: 1 @strNULLABLE:  NULL
  16. -- @tmp_PRECISION: 0,  @tmp_SCALE: 0,  @tmp_RADIX: -1
  17. IF COL_LENGTH( 'as_comments', 'checked') IS NULL
  18.    BEGIN
  19.    ALTER TABLE as_comments
  20.    ADD [checked] datetime NULL  
  21. END
  22. -- Проверка поля checkedBy nvarchar:-- @tmp_NULLABLE: 1 @strNULLABLE:  NULL
  23. -- @tmp_PRECISION: 64,  @tmp_SCALE: 0,  @tmp_RADIX: -1
  24. IF COL_LENGTH( 'as_comments', 'checkedBy') IS NULL
  25.    BEGIN
  26.    ALTER TABLE as_comments
  27.    ADD [checkedBy] nvarchar (64) NULL  
  28. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement