I have a computer running Server SQL 2008. It was not set up by me, it was setup by this software I bought to keep inventory. It has a table I want to transfer to a MYSQL database(since my website works with mysql–the reason I wanna do the transfer.)
So I decided to make a program using VB.NET which reads the data from SQL server 2008 and then insert into the table in MYSQL. I make sure the tables are set up identically and have the same colums and data types per column.
I got one table to transfer completely fine. However, I tried to transfer this certain table and it has a BINARY(8) type column. I should mention that when I do a select on the server computer using MSSM itself, it shows me hex values in the binary(8) column rows. So the values are something like 0x3920409F332D234.
So I obviously set up a table in MYSQL which was identical, but when I tried to pull it out of the server sql and insert to mysql, it throws me errors(Just this specific column.)
In VB.NET, I tried to make a Byte() array to retreive the data after selecting it, and then insert that data with query statement to MYSQL, but it says “too long”. I wasn’t sure if this was the right variable to hold binary data.
To be honest, I’m not sure if I’m even going to be needing this column. I’m not sure what it is. But most of the tables I need have this data, so I want to be safe and keep it.
TY
First, Why are you transferring the data to your website database? If you are just moving it there so you can read it and display values, then you can skip trying to copy that column. Simply put, how and why are you going to display the data if you don’t even know what it is?
Second, I’ve seen purchased software that has used small binary columns (in my software the column name was Timestamp), basically as a save check when in a multi-user environment. Basically, the software reads the value when you open a record and then when you save it will check to make sure the value in the database hasn’t changed. If not it updates. If so, it shows a warning like “Another user has modified this record, please redo your changes and try again.” So its possible that’s all this binary column is.
However, if you still want to copy the data, or at least figure out how to work with binary columns, you’ll have to show some of your code and be more specific with the errors you are getting. Or you can take a look at these resources:
Binary Data in MySQL
simple MySQL binary data inserting