SQL 2005, 2008, 2012
Have a process that creates DB1 by restoring from a db backup. Then hundred of tables in DB1 are truncated and copied from DB0. At the end there is a proc ShrinkDB that does the following PSeudo code.
Alter Database set recovery simple
Shrinkdatabase TRUNCATEONLY
Shrinkfile log file
shrinkfile data file
Alter datbase set recover mode back to oridinal recovery mode
I ran the process to create DB1 without the ShrinkDB proc and the DB1 data file size was the same size as the last time DB1 was created with the ShrinkDB proc. So the data file does not seem to be affect. But the log was 672 mb verses 0.49 mb.
So what should the ShrinkDB proc do? Just the Shrinkdatabase, just the shrinkfile on the log, etc?