Table of ContentsPreviousNext

Ispirer
Please, note, that Ispirer SQLWays 6.0 is no longer supported and provided to clients.
You can try out automated conversion of databases and applications with Ispirer Toolkit for free. Download free trial.
Check out the relevant toolkit documentation.


Ispirer SQLWays Database Migration Software

Conversion of DEFAULT syntax to MySQL

MySQL allows you to specify only constants for the DEFAULT values whereas other databases (Oracle, DB2 etc.) allow you to use expressions like CURRENT DATE as the default. If a DEFAULT value is not constant string or number, SQLWays removes the default option when converting databases to MySQL.

The only exception is if a column of the source database has a datetime data type (date with time part) with the default expression which returns the current system date and time. In this case SQLWays removes the default and converts the data type to the MySQL TIMESTAMP data type. This is because the MySQL TIMESTAMP data type as the default takes the current system date and time:

TABLE 99. Conversion of DEFAULT syntax to MySQL
SQL Server
MySQL
CREATE TABLE table_name1
(
col1 datetime default GETDATE()
) 
CREATE TABLE table_name1
(
col1 TIMESTAMP
); 


Table of ContentsPreviousNext
Copyright 1999-2023 Ispirer Systems.
Ispirer and SQLWays are registered trademarks. All other product names may be trademarks of the respective companies.
All rights reserved.