Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Archiving Sql data into file System

I have a sql database, need to archive the database into filesystem(excel files).

Is the size of the data will increased or not when i migrate to filesystem?

I am doing archive through c# and save into files.

Some of the experts suggested the data of the filesystem is more as compared to the sql data.

is it right or wrong
0
Praveen_Bobbili
Asked:
Praveen_Bobbili
1 Solution
 
AndyAinscowCommented:
Ermmm
There is the overhead of the excel file - so saving one byte into an excel file will result in a file significantly larger than one byte.  Saving one MB will result in only a little more than one MB of file space.

Note that also the disk space is in blocks of fixed size.
eg.  If that size is 4096 bytes then files of 1 byte and 4095 bytes  both reduce the disc space available by the same amount.

However the game is made more complex if you can compress the excel file.

Conclusion.  You need to try it and see.  (With discs the size they are it probably makes no difference in reality, what is a MB or two when the disc is TB capacity).
0
 
Neil RussellTechnical Development LeadCommented:
Silly question but why would you want to "Archive" SQL database data into Excel files?
0
 
anarki_jimbelCommented:
You might be interested in backing up entire database:
http://msdn.microsoft.com/en-us/library/ms187510(v=sql.100).aspx
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
Praveen_BobbiliAuthor Commented:
I don't want to backup entire database.

I may select 1000 records or Entire table and want to save excel or csv,

It increases the size of the files compared to the database Size.

How its happening??
0
 
AndyAinscowCommented:
>>How its happening??

Have you read the first comment concerning your question.
0
 
movendraCommented:
may be you can use sqlcmd command line utility to create a csv file you can open with excel:
sqlcmd -S <server_name> -E -d <db_name> -Q "select * from <table_name> " -s ";" -o "c:\output_file_name.csv"

you can call it from a c# program with "Process.Start"
0
 
Praveen_BobbiliAuthor Commented:
I've requested that this question be deleted for the following reason:

Could find own solution
0
 
AndyAinscowCommented:
Basically the question (will it take more space or not) is only answered by trying as I stated in the first comment.  Later the question changed to only exporting a number (eg. 1000) records and in that case it almose certainly will result in more space, again per my first comment  about the overhead of the excel file.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now