[Company Logo Image] 

Home Up Contents Coffee Break Credits Glossary Links Search

 
Invalid attempt to GetBytes on column

 

 

Home
Analysis Services
Azure
CLR Integration
High Availability
Open Source
Security
SQL Server 2008
SQL Server 2012
SQL Server 2014
SQL Server 2016
SQL Server 2017
SQL Server 2019
Tips
Troubleshooting
Tuning

Invalid attempt to GetBytes on column.


Applies to: SQL Server 2008 R2 Enterprise Edition, SQL Server 2005 Management Studio, Oracle 11g
 

Problem Description.
 

I attempted to query a table located on a remote Oracle server from SQL Server 2005 Management Studio (SSMS) using OPENQUERY and a linked server created on a SQL Server 2008 R2 instance, when we received the following error on SSMS:

Query completed with errors
An error occurred while executing batch. Error message is: Invalid attempt to GetBytes on column 'FECHA_GENERACION'. The GetBytes function can only be used on columns of type Text, NText, or Image.

The T-SQL instruction executed was similar to the following:

SELECT * FROM OPENQUERY(LinkedServerName1, 'SELECT * FROM NOMINA.TABLE1')


Workaround.


The query executed successfully when executed on SQL Server 2008 R2 Management Studio.



 

 

 

.Send mail to webmaster@sqlcoffee.com with questions or comments about this web site.