2013-08-03 80 views
4

以下是我收到的時候我嘗試修改/插入10binary(1)列中的錯誤:修改二進制(1)在SSMS格列

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 Result pane to set this Field data to values other than NULL.

Type a value appropriate for the data type or press ESC to cancel the change.

+0

我會強烈建議您使用'INSERT' /'UPDATE'語句來修改數據,而不是使用'打開Table'或'編輯前N Rows'電網。與電網一起工作看起來可能稍微容易些,但是等待發生的各種問題。這只是你會遇到的很多限制之一...... –

回答

5

這只是它是二進制字段的方式。您必須編寫更新語句來修改該值或插入語句以添加具有值的行。

如果您的列只能包含值0或1,則應該使用bit。可以在SQL Server Management Studio的編輯網格中直接修改bit列。 binary(1)可以保存值0x000xFF

Working with Data in the Results Pane

Values for columns with a binary data type will have NULL values by default. These values can't be changed in the Results pane.

+2

...除非你使用的是舊版本[它仍然期待'true'和'false',並且返回一個錯誤'0'或' 1'](http://connect.microsoft.com/SQLServer/feedback/details/264592/ssms-deprecate-open-table)。 –

+1

此外,這只是強調爲什麼我們都應該使用DML而不是一些古怪的網格,試圖像電子表格一樣對待我們的表格。 –

+0

Mikael Eriksson!謝謝!但它不是這樣,我可以RC按住我的表格並單擊編輯前200行,並插入這個成功 – BlackViking