RE: Creating table with like keyword

RE: Creating table with like keyword

 

  


Hi Dharmesh,

The syntax is

create table table2 like table1

This would also copy the constraints too.

regards,
Kalish.

-----Original Message-----
From: Dharmesh Kumar D. Bajpai
[mailto:db2udbdba-ezmlmshield-x76663611.[Email address protected]
Sent: Saturday, April 21, 2007 5:28 PM
To: LazyDBA Discussion
Subject: Creating table with like keyword



***********************
Your mail has been scanned by InterScan.
***********-***********


Hello,


Can I know the syntax to create a table with 'LIKE' keyword
so as to copy the structure of existing table?


Also, I would like to whether the aforementioned syntax
would also copy constraints and indexes?


Thanks and regards

Dharmesh B





****************************************************************************
*******
This message is for the named addressees' use only. It may contain NSDL

confidential, proprietary or legally privileged information. If you receive
this message in error, please immediately delete it. You must not, directly

or indirectly, use, disclose, distribute, print, or copy any part of this
message

if you are not the intended recipient.Unless otherwise stated, any
commercial

information given in this message does not constitute an offer to deal on
any terms quoted. Any reference to the terms of executed transactions
should be treated as preliminary only and subject to our formal written
confirmation.
****************************************************************************
*******


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




DB2 & UDB email list listserv db2-l LazyDBA home page