SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


LInked server to Oracle database fail data conversion


LInked server to Oracle database fail data conversion

Author
Message
Denise McMillan
Denise McMillan
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1610 Visits: 501
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.
Jo Pattyn
Jo Pattyn
SSCertifiable
SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)

Group: General Forum Members
Points: 7065 Visits: 10009
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search