Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 clear data in a table

Author  Topic 

parry02
Starting Member

18 Posts

Posted - 2006-04-05 : 05:21:08
hi
I would like to clear all data in a table called ... How do I do that - and before I do it I'd like the data copied to a another table as a backup .... Please guide me .....
Thanks in advance .....

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-05 : 05:26:57
[code]
-- backup
select * into table_backup from yourtable

-- clear all data
delete yourtable
or
truncate table yourtable[/code]



KH


Go to Top of Page

parry02
Starting Member

18 Posts

Posted - 2006-04-05 : 05:43:01
select * into Car_trans_backup from Car_transactions

I did that but I'm not sure where the backup table
Car_trans_backup is ?????
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-05 : 05:59:44
It will be stored in the database where you run that query
See what this gives you

sp_help 'Car_trans_backup'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -