I have a SQL Server 2005 database and I have 4 GB of text files that I need to import into it. The question is, if these 4 GB of text files are 1.2 GB when they are zipped, how big would the database be if they are imported? Does SQL Server shrink data by default, or how would I set this (think create a database as a detached item, to be attached to another DB later).
+4
A:
SQL Server will not shrink data by default. In fact, there will be a small overhead per column and row, so it would require more space.
If you really must store those files in the DB (it is recommended that you don't), take a look at this article I blogged a while back. In SQL Server 2008, they have introduced the FILESTREAM type.
Mitch Wheat
2008-10-07 13:01:38
Nice post on the filestream!
edosoft
2008-10-07 14:43:52
it seems the link is dead ...
Philippe Grondier
2008-10-07 19:40:03
just tried it and it worked for me.
Mitch Wheat
2008-10-08 00:33:30
A:
There is no automatic compression - although you could put compressed data in columns it will be difficult to search.
Are these being imported into a set of normalized tables? Are there spaces or other data which will be stripped (commas)?
If so, you can expect space savings from the normalization and the trimming of spaces.
Cade Roux
2008-10-07 13:05:18
+1
A:
There are two primary factors:
- Indexing will increase the space requirement.
- Normalization will decrease the space requirement.
David B
2008-10-07 13:34:44