Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Backup and restore one table
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 6.5 and older
Application:
Web
Divers
Thread ID:
01583196
Message ID:
01583209
Vues:
38
>>>Thank you for the explanation. Ideally I would like to "restore" the table with all indexes, triggers, etc. The way I understand it, is that I would then (after doing a test run) truncate the "good" table and Select from the "backup" table into this "good" table. Can I assume that when I truncate the table, the triggers and indexes will not be affected and therefore Selecting into will Restore?
>>>
>>There are some rules in regards to which table can be truncated and which can not. Assuming that this table can be truncated, then yes, everything will be in place. Watch out for Identity fields, though - you may need to explicitly re-set it when you will be restoring the table.
>
>I am not concerned about identity fields (there is no relation for them to other tables). I just want to be sure that when I do each test run it is executed agains the same set of records.
>Thank you.

Actually, I just verified again

"TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes, and so on remain. To remove the table definition in addition to its data, use the DROP TABLE statement.
If the table contains an identity column, the counter for that column is reset to the seed value defined for the column. If no seed was defined, the default value 1 is used. To retain the identity counter, use DELETE instead."

Check http://technet.microsoft.com/en-us/library/ms177570.aspx
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform