BITS LONGVAR
BITS_LENGTH INTEGER
I'm using the following to insert the BITS information
BITS=CAST(CAST([MyTEXT] AS VARCHAR(8000)) AS VARBINARY(8000))
How do I calculate the BITS_LENGETH? I tried the following but it won't execute: INSERT INTO [Database].[dbo].[BINARY_TABLE] ([IDnum] ,[LineNum] ,[TYPE] ,[BITS] ,[BITS_LENGTH]) SELECT LTRIM(RTRIM([IDno])) AS IDnum ,[Line] ,'H' ,cast(cast([MyText] as varchar(max)) as varbinary(max)) ,DATALENGTH([MyText]) FROM [Database].[dbo].[TEMP_TABLE]