Solved

Querying Datefield from MSSQL LINKED From MySQL

Posted on 2008-10-23
3
699 Views
Last Modified: 2012-06-27
I have MSSQL and MySQL Linked together. This is a temporary solution. What I can't do is pull the date field from MySQL into SQL Server.

Query:
SELECT * FROM openquery(LINK, 'SELECT entry_date,territory  FROM thstew_orders.oetable_backup')

MySQL Data Type for DATE FIELD = DATE

Error Message I receive:
Msg 8114, Level 16, State 8, Line 1
Error converting data type DBTYPE_DBTIMESTAMP to datetime.

what can I do?

Thanks,
Jeff
0
Comment
Question by:jseaman12
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Marten Rune earned 500 total points
ID: 22785665
MySQL is not my bag of tea but...

You could modify the field in SQL to varchar(30) or something like that and then you will see what you are getting. In order to convert this string to date, I can surely help, just paste what you get in the varchar field.

/Marten
0
 

Author Comment

by:jseaman12
ID: 22792375
Marten,

I ended up resolving the issue with a solution I figured out. Something called QA. It seems that the end users have entered in incorrect date formats such as 0007 as the year. That's why MSSQL couldn't figure it out.

Thanks for your support.

-Jeff
0
 

Author Closing Comment

by:jseaman12
ID: 31509175
It turned out that the data needed to be QA. The solution would have worked if the QA wasn't the problem.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now