In Microsoft SQL Server Management Studio (SSMS), you can right-click on a table and then go to Script Table as
β SELECT To
, and then select the destination for the generated script.
Is there something similar in DataGrip, or is it possible to somehow create a custom structure?
The reason I find this useful is because I often find that I work with a table with a lot of columns, and I want to select all but a few of them. Therefore, itβs easier to just generate a SELECT statement with all explicitly specified columns so that I can just go through and delete the ones that I donβt need.
My current workaround in DataGrip is to right-click on a table, then select Copy DDL
. This generates a CREATE TABLE statement, which lists all columns, but also includes column definitions. Therefore, I have to make a regular expression, replace or run a macro to get rid of additional information, which is a kind of pain. Does anyone have a better solution?
source share