Run a select statement with get_ddl in it like in the example below – then click on the result and in the resulting window copy:
If you don’t do that and simply click on the “Copy” button that I label “do NOT click on this copy” – you will get a unformatted string of DDL like this (and I assume most of the time you do not want this – you want the formatted / “pretty” version):
GET_DDL('TABLE','MYSCHEMA.ORDERS_EX_CLONE2') create or replace TABLE ORDERS_EX_CLONE2 ( ORDER_ID VARCHAR(30), AMOUNT NUMBER(38,0), PROFIT NUMBER(38,0), PROFITABLE_FLAG VARCHAR(30) );
Of course if you are using Snowsight – the new Snowflake UI that at the time of this writing is still in preview – it’s a little more intuitive – there is NO wrong button to click on.