SQL Server tip
Posted by Diego em Julho 12, 2011
Just a quick post in case anyone else is having the same problem that I had.
If you execute a query like this on a SQL Server 2008 database from a SSMS 2005:
SELECT TOP 10 *
and get the following error message:
An error occurred while executing batch. Error message is: Invalid attempt to GetBytes on column ‘BirthDate’. The GetBytes function can only be used on columns of type Text, NText, or Image.
Notice that’s probably because you are connected to the 2008 instance with a 2005 SSMS client.
Apparently, date fields cannot be bound to a SSMS 2005. That’s probably (not sure, just guessing) due to the fact that it is a new data type on SQL Server 2008.