Re: copy table structure
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 02/02/05
- Next message: Hugo Kornelis: "Re: Converting a field from int to varchar during query"
- Previous message: Jig Bhakta: "Converting a field from int to varchar during query"
- In reply to: GW: "copy table structure"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 02 Feb 2005 22:09:32 +0100
On Wed, 2 Feb 2005 04:07:06 -0800, GW wrote:
>Appreciate it if someone can show me how to copy table structure to a new
>table without the data using a query.
Hi GW,
You could use
SELECT *
INTO NewTable
FROM OldTable
WHERE 1 = 0
This will copy the columns and datatypes; it won't copy defaults,
constraints, properties and such.
However, I'd be interested to know why you want to do this. What is the
goal?
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Hugo Kornelis: "Re: Converting a field from int to varchar during query"
- Previous message: Jig Bhakta: "Converting a field from int to varchar during query"
- In reply to: GW: "copy table structure"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|