views:

177

answers:

4

I'm not clear about the interaction between database schema changes and differential backups on sql 2005.

Lets say I do a Full backup right right now. Then I perform some schema changes. Then I do a diff backup.

What happens? Do I need to create another FULL backup? Are my schema changes and any data in those new schema bits included in my diff backup?

A: 

Firstly, I don't use differential backups... so I guess you can take this opinion with a pinch of salt(!).

I fully expect that the schema changes would be included in the differential backup - how couldn't they be? Changes to your DB all boil down to transactions of some description... So if you wanted to restore your database, you'd have to restore the full back and then the latest differential. This seems straight-forward and would be trivial to test/prove.

Is there another question behind your question? Why do you ask?

CJM
No hidden question.
jfar
As a separate issue, I'd script any changes to your DB, and then store these scripts alongside your application code in VSS/TFS/SVN etc so you have transparency over what changes were made and when.
CJM
This is incorrect. When applying differentials, you only have to apply the most recent differentials, not "any subsequent differentials" as the answer states.
Brent Ozar
+1  A: 

Yes, you are correct.

All changes, whether structural changes or data modifications, within the database (i.e. any object that resides within the database) since your last full database backup will be recorded by any subsequent differential backup that you execute.

I hope this clears things up for you but please feel free to pose further questions.

cheers, John

John Sansom
+1  A: 

Yes, all changes to the table will be kept in the differential backup. This includes all DDL code that is executed against the database.

mrdenny
+1  A: 

As mentioned, a non-full backup (LOG or DIFF) includes all schema changes.

Remember: user tables, column, stored proc defs, indexes, the whole shebang are stored in tables that exist on disk in data pages just like your data...

gbn