TablePlus icon indicating copy to clipboard operation
TablePlus copied to clipboard

Microsoft SQL Server | Copy Script As > Creation | Missing some features

Open adrum opened this issue 1 year ago • 0 comments

Please answer the questions below, it helps us to keep track of the issue. Please do not ignore it or your issue will be closed.

  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0):

Microsoft SQL Server 2019

  1. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81):

5.9.0 (538)

  1. The steps to reproduce this issue:

Create a table with the following:

CREATE TABLE [dbo].[test2] (
    [id] INT IDENTITY(1,1),
    [created_at] datetime DEFAULT (getdate()),
    [name] nvarchar(255),
    [rate] decimal(10, 2),
);

Now, right-click on the table and select Copy Script As > Creation. That should yield the example below:

CREATE TABLE [dbo].[test2] (
    [id] int,
    [created_at] datetime DEFAULT (getdate()),
    [name] nvarchar,
    [rate] decimal
);

Ideally, it would be identical to the first command. The generated creation had an nvarchar of one length, and a decimal of 18 with no precision.

adrum avatar Feb 16 '24 23:02 adrum