Export database as SQL produces invalid output for MSSQL · Issue #1101 · HeidiSQL/HeidiSQL · GitHub
Skip to content

Export database as SQL produces invalid output for MSSQL #1101

Closed

Description

@GPHemsley

Steps to reproduce this issue

  1. Create a table with complexities like default null columns, collations, bit fields with defaults, etc.
  2. Run Tools > Export database as SQL with Table Create checked.

Current behavior

SQL output is mostly MySQL format, with a few superficial MSSQL-specific changes.

For example:

  • MySQL special comments are outputted.
  • IF NOT EXISTS is used.
  • COLLATE appears in the wrong place and has its value quoted.
  • DEFAULT NULL is used.
  • Defaults for BIT columns are quoted.

Expected behavior

SQL output is in MSSQL syntax.

Possible solution

SQL output is derived from MSSQL syntax directly:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-2016

Environment

  • HeidiSQL version: Version 11.0.0.6055 (64 Bit)
  • Database system and version: MSSQL 13.0 (SQL Server 2016)

Activity

  1. GPHemsley commented on Jul 22, 2020

    @GPHemsley
    Author

    Oops, this is a duplicate of #118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions