Skip to main content

I am working with a new database starting with drawing it up using lucid and ERD. A few questions came up:

  • How - if possible - do I arrange tables in different schema’s?
  • How - if possible - do I say that a column is an identiy column so that the DDL is generated with this information?

Great questions! Tables can be arranged into schemas by connecting keys through lines. These lines represent the relationships between the tables and the cardinality can be dictated by the line ending. Additionally, the ‘key’ column is the identity column. The key column will appear when you choose the ERD shape that has 3 or columns or 2 columns (and the left column is skinnier than the right). 

This Help Center Article will walk you through generating an ERD. 

Happy ERDing!


Hi Kristiy,

 

that is not exactly what I am after.

I will try to explain. I first started with the model - but got stuck so I took another aproach.

I first created a few tables in SQL Server:

CREATE SCHEMA HR AUTHORIZATION dbo

CREATE TABLE hr.employee (
    id INT IDENTITY(1,1) PRIMARY KEY,
    name NVARCHAR(128)
);

CREATE TABLE hr.company (
    id INT IDENTITY(1,1) PRIMARY KEY,
    employeeId INT FOREIGN KEY REFERENCES hr.employee(id),
    name NVARCHAR(128)
);

Then I imported this into lucid chart:

But if I then export this again I get:

CREATE TABLE EHR.employee] (
  ]id] int,
  iname] nvarchar(128),
  PRIMARY KEY ( id])
);

CREATE TABLE >HR.company] (
  aid] int,
  demployeeId] int,
  Iname] nvarchar(128),
  PRIMARY KEY (/id]),
  CONSTRAINT bFK_HR.company.employeeId]
    FOREIGN KEY (/employeeId])
      REFERENCES rHR.employee](Eid])
);

 

This will create a table named HR.employee in dbo schema, not the HR schema.

The id columns are not identity columns anymore.

How can I generate these tables to the HR schema and keep the information that the columns are identity columns?


Hi @Arvid Haugen, thanks for the response and additional information. I’ve converted your post to a support ticket so our team can take a closer look at your import and export files and give more direction on what may be going on. Thanks for your patience! 


Reply