Generate Table DDL How to include schema?
Answered
Hi,
I am wondering if it's possible to some set it so datagrip include the schema when generating the DDL for a table
right click table -> sql scripts -> generate ddl to clipboard/query console
Right now the table ddl is generated but the schema isn't included. Looking for that to be included as well.
Please sign in to leave a comment.
Jonnoadams2,
Use SQL Generator feature. It's described in IDE documentation https://www.jetbrains.com/datagrip/features/generation.html
Hi! the same here…
example. i have some db - “SomeDb”, one user and 2 schemas
- dto - default schema
- ctm - my custom schema
SQL Generator do job for dto without any problem. But when i want generate script for “ctm” schema - its not specify schema for table create.
SQL Generator generate just some like this:
create table MyTable
(
Id int identity primary key,
State int default 0 not null,
Type bit default 0 not null
)
but should (expected) be some like:
create table [ctm].MyTable
(
Id int identity primary key,
State int default 0 not null,
Type bit default 0 not null
)
Thanks
UDP. Sorry, i missed that this feature already implemented.

in Qualify objects with shema names - just change “auto” to “Always”.
Thanks!