Skip to content

Not able to generate Table DDL for more than one table #61

@varun-dhawan

Description

@varun-dhawan

Hi Team
I'm trying to generate Postgres compatible code for below SQL Server create table script. The input has two tables, however the output generates DDL only for first table. Not sure if this is an issue or I'm missing something. Please help / advise:

SQL-Server-Input-File
`### CREATE TABLE [dbo].[AWBuildVersion](
[SystemInformationID] [tinyint] IDENTITY(1,1) NOT NULL,
[Database Version] nvarchar NOT NULL,
[VersionDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_AWBuildVersion_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_AWBuildVersion_SystemInformationID] PRIMARY KEY CLUSTERED
([SystemInformationID] ASC));

CREATE TABLE [dbo].[DatabaseLog](
[DatabaseLogID] [int] IDENTITY(1,1) NOT NULL,
[PostTime] [datetime] NOT NULL,
[DatabaseUser] [sysname] NOT NULL,
[Event] [sysname] NOT NULL,
[Schema] [sysname] NULL,
[Object] [sysname] NULL,
[TSQL] nvarchar NOT NULL,
[XmlEvent] [xml] NOT NULL,
[SRC_I] [int] NULL,
[ProtocolTypeID] [int] NOT NULL DEFAULT ('9'),
CONSTRAINT [PK_DatabaseLog_DatabaseLogID_ProtocolTypeID] PRIMARY KEY CLUSTERED
([DatabaseLogID] ASC,[ProtocolTypeID] ASC));`

Postgres Output Script
`\set ON_ERROR_STOP
\set ECHO all
BEGIN;

CREATE TABLE "public"."awbuildversion"(
"systeminformationid" smallint NOT NULL,
"database version" varchar(25) NOT NULL,
"versiondate" timestamp NOT NULL,
"modifieddate" timestamp NOT NULL);

COMMIT;
`

  • Varun

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions