| Author |
Topic |
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-28 : 12:17:33
|
| I am trying to retrieve data from MYSQL to the SQL Server but I keep recieving an error message.Insert error, column 2('unsubscribe_date', DBTYPE_DBTIMESTAMP), status 6: Data overflow. Invalid character value for cast specification.The format in the MYSQL field is DATEThe format in the SQL Server is smalldatetimeHow will i manage to complete this command without changing anything in MYSQL tables.Thanksintrolux |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 12:29:51
|
| What's the dateformat of values coming from MySQL? |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-28 : 12:31:15
|
| 2007-09-21 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 12:41:28
|
quote: Originally posted by introlux 2007-09-21
Then i dont guess that could be a problem.have you tried using CAST or CONVERT before insertion? |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-28 : 12:52:45
|
| I am not sure to correct method to do it. I have tried the examples online but has not worked, which then this web site came up with good help offered by members. So im here to resolve this problem (hopefully fingers crossed)introlux |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 12:56:59
|
quote: Originally posted by introlux I am not sure to correct method to do it. I have tried the examples online but has not worked, which then this web site came up with good help offered by members. So im here to resolve this problem (hopefully fingers crossed)introlux
Can i see query you used? |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-28 : 13:01:05
|
| -----------------------Table creation------------------------------CREATE TABLE [MaRSCHORPanel].[dbo].[unsubscribe_copy1]([Marsc_id] decimal(10, 0) NOT NULL, [unsubscribe_date] smalldatetime NOT NULL, [email] varchar(150) NOT NULL, [source_id] varchar(50) NOT NULL, [unsubscribe_id] int NOT NULL)------------------------------------------------------------------------------------------Taking data from other MYSQL------------------select `Marsc_id`,`unsubscribe_date`,`email`,`source_id`,`unsubscribe_id` from `pyramid`.`unsubscribe`---------------------------------------------------------------------As far as i know, the command has to be put in the 1st part.introlux |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-28 : 13:05:25
|
| Try using CAST(unsubscribe_date as smalldatetime) |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-28 : 13:18:50
|
| Error message:You have an error in your SQL syntax. Check the manual that corresponds to your version for the right syntax to use 'CAST(unsubscribe_date as smalldatetime)' at line 1 |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-29 : 03:53:11
|
| any luck?? |
 |
|
|
introlux
Starting Member
7 Posts |
Posted - 2008-05-29 : 05:03:40
|
| Sorted out problem, changed from smalldatetime to DATETIME and it worked :-)Thanks for all the supportintrolux |
 |
|
|
|