Solved

Querying Datefield from MSSQL LINKED From MySQL

Posted on 2008-10-23
3
700 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

832 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