By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

SQL DDL to rename table and rename field

P: n/a
Hello

Does anybody know how to change table name (and field name) using
SQL query ?

I want to use it from Delphi/ADO.

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It would be easier to create a new table w/ the new name and column name
& then copy the data from the old table, then delete the old table.

Example:

CREATE TABLE <new table> (
col1 integer,
col2 varchar(25),
col3 tinyint
)

INSERT INTO <new table> (col1, col2, col3)
SELECT col1, col2, old_col FROM <old table>

DROP TABLE <old table>

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQQRrwYechKqOuFEgEQK73gCfX/xAni9aniEcFqEvHvOwfHGnqEkAoL0m
PlIG7Ev2wG0HTvb9TUue6fzG
=3CbF
-----END PGP SIGNATURE-----
Shimon Sofer wrote:
Hello

Does anybody know how to change table name (and field name) using
SQL query ?


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.