Change binary (1) column in SSMS grid

The following is the error I get when I try to change / insert 1 or 0 into the binary(1) column:

Invalid value for cell (row 4, column 5).
The changed value in this cell was not recognized as valid.
.Net Framework Data Type: Byte []
Error message: You cannot use the results pane to set field data for non-NULL values.

Enter a value that matches the data type, or press ESC to discard the change.

+4
source share
1 answer

This is the same as for binary fields. You must write an update statement to change the value or an insert statement to add a row with the value.

If your column can only have values ​​0 or 1, you should use bit . The bit columns can be changed directly in the editing grid in SQL Server Management Studio. binary(1) can contain values 0x00 to 0xFF .

From Working with data in the results pane

Values ​​for columns with a binary data type will default to NULL. These values ​​cannot be changed in the Results panel.

+5
source

Source: https://habr.com/ru/post/1495137/


All Articles