Solved

Querying Datefield from MSSQL LINKED From MySQL

Posted on 2008-10-23
3
698 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Creating and Managing Databases with phpMyAdmin in cPanel.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

744 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

12 Experts available now in Live!

Get 1:1 Help Now