Arquivo

Archive for Julho, 2011

SQL Server tip

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 *
FROM AdventureWorksDW2008.dbo.DimCustomer

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.

Categories: SQL, T.I.
Seguir

Get every new post delivered to your Inbox.