LInked server to Oracle database fail data conversion

  • On a SQL Server instance I have a linked server to an Oracle database. If I run query using a date it is ok from SSMS master database. But if I try to run it in a user database the date conversion fails. Is this the way it is, I have to use master? Or can I fix the conversion?

    Query has:

    ... where Linkname..databasename.datefield = '2011-01-01 00:00:00.0000000'

    It runs fine in master but when run in a user database I get error:

    "Conversion failed when converting date and/or time from character string"

    Thanks.

  • make sure you make it a date-datatype instead of a string using cast or convert

    Comparing dates with strings is usually a recipe for disaster

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

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