You see things; and you say 'Why?' But I dream things that never were; and I say 'Why not?'

Monday, February 9, 2009

Taking a backup or creating a duplicate table

Taking a backup of a table

Here it creates the table name TEST1 from TEST and copies the content accordingly

SELECT SID,CLASS,DEPT,DATE,SALARY,NAME INTO TEST1
FROM TEST


Here it copies the whole table by creating a table name along with the field names

SELECT * FROM TEST1

or

SELECT * INTO TEST1 FROM TEST

No comments:

Followers