Pay attention to file length in database project after a synchronization

One of the coolest feature of Database Projects in VS2008 is the ability to synchronize the database project with a physical instance of SQL server.

This is useful if not all people from the team have the ability to run a database project (this is solved in vs2010 where database project are available even in the professional edition), or if some DBA makes modification to a database with management studio.

After a full synchronization occurs double check the file structure, because the synchronization procedure store size of the files into the definition

1
2
3
4
5
ALTER DATABASE [$(DatabaseName)]
ADD FILE (NAME = [xxxxx], FILENAME = '$(VirtualDiskDataPath)\xxxxxx.ndf',
SIZE = 6586816 KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 10 %) TO FILEGROUP [xxxxxx];

the SIZE parameter is really huge, and this can slow down deploy process during unit testing. Keep this in mind and always take a look to the file definition after you sync a database project with a live database.

You can always avoiding to update file definition (because they rarely change) to avoid this problem

image

alk.

Tags: Database Project