I’m transferring a small database from MySQL to MSSQL.
the current MySQL example declaration:
*(Keys and Not Null are intentionally skipped)
CREATE TABLE my_table(
`id` bigint(20),
`version` int(10),
`user_id` tinyint(3) unsigned, /*less then 100*/
`date_crated` int(11), /*unix time like 1334736752 */
`image_content` blob,
`xml_content` longtext /*xml with non english texts, 5000+ character*/
)
And my MSSQL variant:
CREATE TABLE [my_table](
[id] bigint,
[version] int,
[user_id] tinyint,
[date_crated] int,
[image_content] varbinary(MAX),
[xml_content] nvarchar(MAX)
)
I m not confident about the last three…
Is there any potential data lost this way ?
Looks good to me except for
date_createdandversion: I’d go forbigint(64 bit, UNIX timestamp was widened from 32 bit to 64 bit) ortimestamp— MSSQL int is 4 Byte (32 bit). You should also check if you need 64 bit integers forversiontoo.