Operand type clash inserting ntext

  • Here is what I am trying to do:

    update MyTable

    set [value] =

    (select BulkColumn FROM OPENROWSET(Bulk 'C:\MyFile.txt', SINGLE_BLOB) as blob)

    The error:

    Msg 206, Level 16, State 2, Line 3

    Operand type clash: varbinary(max) is incompatible with ntext

    The table:

    CREATE TABLE [dbo].[MyTable](

    [column1] [varchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

    [column2] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [value] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [column4] [datetime] NULL,

    [column5] [varchar](32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

    I get the same error if instead of update I do an Insert into. My confusion is I do not see the datatype "varbinary(max) in play anywhere here.

  • I'm not real familiar with OPENROWSET, but it appears that the OPENROWSET command in SQL Server 2005 is using varbinary(max) as the SQL Server datat type for SINGLE_BLOB in the process.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply