Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009

    Unanswered: Binary(8) datatype - need help

    I need some help. please.

    I am working with an existing database that has a field defined as 'data type" = binary(8). The field in existing records is populated with "<Binary data>". Not sure exactly how or where this is utilized, but I need to add additional records to this table but I am unable to enter anything but "NULL" into this field.

    Not sure what was used to create the SQL database but I am trying to modify using the following tool:

    Microsoft SQL Server Management Studio Express 9.00.2047.00
    Microsoft Data Access Components (MDAC) 6.0.6002.18005 (lh_sp2rtm.090410-1830)
    Microsoft MSXML 3.0 5.0 6.0
    Microsoft Internet Explorer 8.0.6001.18813
    Microsoft .NET Framework 2.0.50727.4016
    Operating System 6.0.6002

    Following is the error I get when I try to modify the field

    Microsoft SQL Server Management Studio Express
    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.
    OK Help

    Any help in this matter would be greatly appreciated. Thanks

  2. #2
    Join Date
    Jul 2003
    San Antonio, TX
    You shouldn't be using SSMS as your data editor. To populate the values of binary(8) you need to issue an insert statement, similar to the sample below:

    create table #test (f binary(8))
    insert #test select cast('test' as binary(8))
    select cast(f as varchar(4)) from #test
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts