Solved

Querying Datefield from MSSQL LINKED From MySQL

Posted on 2008-10-23
3
703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

691 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