Microsoft
Software
Hardware
Network
Question : Migrating date from MySQL to MSSQL run time error issue
Hi,
I am trying to migrate data from a table in MySQL to MSSQL.
I have been using SSIS Packages in Microsoft Visual Studio to help me do this but i have come across a problem. When pulling the informaion from the MySQL database i get a run time error.
This is the code i have been using:
TRUNCATE TABLE [DataView].[dbo].[CUSTOMER
_HISTORY_T
EMP];
GO
BEGIN
DECLARE @max_time VARCHAR(255), @remote_query VARCHAR(255)
SELECT @max_time = CONVERT(varchar,ISNULL(MAX
(dw_timest
amp),CAST(
'1990-01-0
1' AS DATETIME)),120)
FROM [DataWarehouse].[dbo].[CUS
TOMER_HIST
ORY];
SET @remote_query = 'SELECT * FROM CUSTOMER_HISTORY WHERE dw_timestamp>="' + @max_time + '" ORDER BY history_id limit '
DECLARE @record_count INT, @while_counter INT, @limit_start INT, @limit_amount INT
SET @limit_start=0
SET @limit_amount=1000
SET @while_counter=-1
SELECT @record_count=count(*) FROM [DataView].[dbo].[CUSTOMER
_HISTORY_T
EMP]
WHILE @while_counter<@record_cou
nt
BEGIN
DECLARE @final_query VARCHAR(255)
SET @final_query = @remote_query + CAST(@limit_start AS VARCHAR) + ',' + CAST(@limit_amount AS VARCHAR)
INSERT INTO [DataView].[dbo].[CUSTOMER
_HISTORY_T
EMP]
EXEC('SELECT * FROM OPENQUERY(IBBINTRAISP_LOCA
L,''' + @final_query + ''') AS subq');
SET @while_counter=@record_cou
nt
SELECT @record_count=count(*) FROM [DataView].[dbo].[CUSTOMER
_HISTORY_T
EMP]
SET @limit_start= @limit_start + @limit_amount
END
END
--This is the Error i am recieveing when i run this:
OLE DB provider "MSDASQL" for linked server "IBBINTRAISP_LOCAL" returned message "Requested conversion is not supported.".
Msg 7341, Level 16, State 2, Line 1
Cannot get the current row value of column "[MSDASQL].history_text" from OLE DB provider "MSDASQL" for linked server "IBBINTRAISP_LOCAL".
Any thought would be appriciated,
Thank you.
Answer : Migrating date from MySQL to MSSQL run time error issue
Hi,
This looks like you have a data casting problem. Certain field datatypes will need special handling. See this page for more info:
http://forums.microsoft.co
m/MSDN/Sho
wPost.aspx
?PostID=30
4025&
SiteI
D=1
Regards,
Lee
Random Solutions
Services Crashing Multiple Times Per Day: wuauserv, bits, browser, trkwks, dmserver, seclogon, lanmanserver, audiosrv, sharedaccess, wzcsvc, and lanmanworkstation
Unerase files on a CD-RW ?
How to fix Win cannot locate the srv copy of roaming file, running Samba
Estimating live chat traffic?
HELP!! Computer gone nuts!!
E-Mail Stuck in Outbox
ACPI Unable to locate RSDP - Fedora Core 6
How do I get Apache visible to the internet?
When Using Acrobat 9 Pro Extended to Create PDFs from Word 2007 my Images have Unwanted Borders
php solution to change url of a page using mod rewrite and .htaccess