|
Home > Archive > SQL Anywhere Feedback > December 2005 > CREATE TABLE xxx LIKE yyy WITH[OUT]...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CREATE TABLE xxx LIKE yyy WITH[OUT]...
|
|
| Breck Carter [TeamSybase] 2005-08-11, 8:23 pm |
| Still want this, as a SQL statement rather than a Sybase Central
wizard. It would be very helpful when creating temporary tables that
look like permanent ones, local tables that look like proxy tables,
etc.
Breck The Product Futures Historian :)
>From: "Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com>
>Subject: CREATE TABLE xxx LIKE yyy WITH[OUT]...
>Date: Sat, 22 Mar 2003 13:58:45 -0500
>Newsgroups: sybase.public.sqlanywhere. product_futures_disc
ussion
>
>CREATE TABLE xxx
> LIKE yyy
> [ WITH[OUT] PRIMARY KEY ]
> [ WITH[OUT] FOREIGN KEYS ]
> [ WITH[OUT] INDEXES ]
> [ WITH[OUT] OTHER CONSTRAINTS ]
> [ WITH[OUT] TRIGGERS ]
>
>To facilitate the creation of a new table with the same schema as an
>existing table, with or without various constraints and triggers. The
>defaults would all be "WITH".
>
>Breck
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Michael Gould 2005-08-12, 7:23 am |
| Breck,
I'd love to see this and also add the [ Global Temporary] and it's
attributes.
Regards,
Michael Gould
"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> wrote in
message news:eqenf11tc5nhrs8
3vra9el7i5hga0paq6r@
4ax.com...
> Still want this, as a SQL statement rather than a Sybase Central
> wizard. It would be very helpful when creating temporary tables that
> look like permanent ones, local tables that look like proxy tables,
> etc.
>
> Breck The Product Futures Historian :)
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:
> http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
| |
| Breck Carter [TeamSybase] 2005-08-12, 11:23 am |
| Yes, I think the LIKE... attribute should be available when creating
any kind of table.
Breck
On 12 Aug 2005 04:21:13 -0700, "Michael Gould"
<mgould@removeme.omnicc.com> wrote:
>Breck,
>
>I'd love to see this and also add the [ Global Temporary] and it's
>attributes.
>
>Regards,
>
>Michael Gould
>
>"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> wrote in
>message news:eqenf11tc5nhrs8
3vra9el7i5hga0paq6r@
4ax.com...
>
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Erik Anderson 2005-08-12, 1:23 pm |
| If you're talking local temporary tables, there's always the "select * into
#temp from dba.Table" statement...
"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> wrote in
message news:9qhpf19b5745a0v
822h5kcf41s9leul2cn@
4ax.com...
> Yes, I think the LIKE... attribute should be available when creating
> any kind of table.
>
> Breck
>
> On 12 Aug 2005 04:21:13 -0700, "Michael Gould"
> <mgould@removeme.omnicc.com> wrote:
>
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:
> http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
| |
| Breck Carter [TeamSybase] 2005-08-12, 1:23 pm |
| On 12 Aug 2005 09:31:07 -0700, "Erik Anderson"
< erikba@teamworkgroup
.com> wrote:
>If you're talking local temporary tables, there's always the "select * into
>#temp from dba.Table" statement...
Yes, indeed, that is a powerful statement... one of those rare
Transact SQL features that is actually useful :)
What I am asking for, however, is to be able to create a new *empty*
table of any type, from an existing table of any (possibly different)
type. And to do this via script rather than wizardly click'n'clack.
Breck More Like Gollum Than Gandalf :)
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Dan Konigsbach 2005-09-02, 3:24 am |
| As long as we are fantasizing about a CREATE TABLE ... LIKE, I'd love
an ability to specify a partial list of column names, where the columns
I specify appear first, in that order, in the new table, and the
remaining columns of the original table (other than the ones excluded
by WITHOUT) appear afterwards. Frankly, I wouldn't care whether the
unspecified columns are in the same order as the source table or in an
undefined order, leaving ASA the opportunity to apply its smarts.
WHY do I want to impose a column order, <sarcasm> when everyone knows
that column order is irrelevant in a relational database </sarcasm>?
- Circumstances force me to add a segment to the primary key, and it
should be in front of the existing primary key.
- I want to put smaller or more frequently used fields at the front of
the row.
I desperately do not want to be required to list all of the fields to
successfully CREATE a duplicate of my table. That makes the CREATE
TABLE extremely dependent on getting all of the columns listed
correctly. If any are added later, your CREATE would succeed sans
those columns, and you end up losing data. I've seen it happen.
It's ugly.
| |
| Pavel Karady 2005-12-27, 9:23 am |
| >>CREATE TABLE xxx[color=darkred]
I'm adding my vote (at least I hope this is the correct way of "voting").
It's impossible to imagine how many headaches around the world would this
statement remove.
Pavel
|
|
|
|
|