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.
Author |
Topic |
Michael71
Posting Yak Master
126 Posts |
Posted - 2007-01-17 : 16:04:27
|
How do I delete all data in a table and leave the data types and structure...please help... |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-01-17 : 16:11:26
|
DELETE FROM YourTable -- this command is fully loggedorTRUNCATE TABLE YourTable -- this command is partially logged and requires that no child constraints existTara Kizer |
|
|
Michael71
Posting Yak Master
126 Posts |
Posted - 2007-01-17 : 16:19:27
|
got this error...Msg 208, Level 16, State 1, Line 1Invalid object name 'PO_header'. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-01-17 : 16:26:42
|
You're probably in the wrong database then or that object doesn't exist. The commands I gave you are correct.Tara Kizer |
|
|
Michael71
Posting Yak Master
126 Posts |
Posted - 2007-01-17 : 16:28:54
|
The table does exist. I'm looking at it. |
|
|
Michael71
Posting Yak Master
126 Posts |
Posted - 2007-01-17 : 16:30:40
|
I was in the wrong database. |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2007-01-17 : 19:07:16
|
ADVICE: Make sure you back up your data, your actions cant be reversed |
|
|
sql_er
Constraint Violating Yak Guru
267 Posts |
Posted - 2007-01-30 : 16:15:40
|
or use BEGIN TRAN-- Delete your stuff here-- Check to make sure that you deleted what you wanted - no less no moreCOMMIT -- If you are happy with deletionsROLLBACK -- if you are not happy with deletions |
|
|
|
|
|