locked
The type initializer for 'ReplaceableCharacters' threw an exception. (table with varchar column with default value) RRS feed

  • Question

  • Any table with columns which have default string value fails to convert. On following example it fails because of column C5.
    if I remove the default then it works
    MY Sql 5.7
    Sql Server 2012
    SSMA 7.3

    CREATE TABLE `TableTest1` (
      `C1` int NOT NULL,
      `C2` varchar(255) NOT NULL,
      `C3` varchar(255) NOT NULL DEFAULT 'Open',  
      PRIMARY KEY (`C1`)
    ) ENGINE=InnoDB;
    Friday, May 26, 2017 9:26 AM

All replies

  • Hi Mike,

    >> Any table with columns which have default string value fails to convert. On following example it fails because of column C5.

    I see no problem with the conversion during my test. So you mentioned column C5 and it’s not in your sample code, could you please elaborate more on this? Here’s the sample I got from SSMA after conversion:
    CREATE TABLE 
    [test].[tabletest1]
    (
       [C1] int  NOT NULL,
       [C2] nvarchar(255)  NOT NULL,
       [C3] nvarchar(255)  NOT NULL
    )
    WITH (DATA_COMPRESSION = NONE)
    GO
    
    ALTER TABLE [test].[tabletest1]
     ADD CONSTRAINT [PK_tabletest1_C1]
       PRIMARY KEY
       CLUSTERED ([C1] ASC)
    GO
    
    ALTER TABLE  [test].[tabletest1]
     ADD DEFAULT N'Open' FOR [C3]
    GO

    If you have any other questions, please let me know.

    Regards,
    Lin

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 29, 2017 7:09 AM
  • Hi,

    Just wanted to let you know that we addressed this issue in SSMA 7.4. You can download the latest version here: https://aka.ms/ssmaformysql

    Regards,
    Alex.

    Tuesday, May 30, 2017 3:35 PM
  • Hi Lin,

    Sorry for the typo, it is C3 which did not convert.

    However looking at your code and doing extra test here is my findings:

    I down graded to version SSMA 7.0.0

    Using "MySQL ODBC 5.3 ANSI Driver (v5.3.8); 64 bit" provider to connect to MySQL causes the error.

    However if use the UNICODE driver, it will produce the same code as yours.


    Thursday, June 1, 2017 10:13 AM
  • Hi Mike,

    >>Using "MySQL ODBC 5.3 ANSI Driver (v5.3.8); 64 bit" provider to connect to MySQL causes the error.

    I’m not quite sure about that, both ANSI/Unicode driver 5.3.6 works fine for me. But as Alexander mentioned, please consider upgrade to latest SSMA for better work experience.

    If you have any other questions, please let me know.

    Regards,
    Lin

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 9, 2017 2:44 AM