storing design file (contents) in sql server and performance

Posted on 2012-03-31
Last Modified: 2012-08-14

I'm writing a code which is dealing with dxf files (basically is a text file generated by AutoCad). now, in a part of the project I need to store it. Its contents can be something like:


however, it gets to several thousands of lines. I'm thinking of saving it in a field as Varchar(MAX) which supports up to 2GB of information.


Can an expert advise me on this?


the code will read dxf files from an input and stores them in sql server 2008 and yet it has to be able to reopen and show the design. this make me think of storing the files on storage device and instead store only the path/file name in the database since there will be more steps that have to go through connecting to the database, locating the data, reading the contents and creating a temp dxf file. Any advice?
Question by:akohan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 80 total points
ID: 37792463
I would just put the path/file name in the database.  Putting the file itself in the database can take up a lot of space which can slow the database access down, requires a program to recreate the file (wasting more time), and can only be backed up by backing up the database.
LVL 20

Expert Comment

ID: 37793865
in case you still want to store file content in DB rather than its path, use varbinary(max) instead of varchar(max)...

here is an example to help you:-
LVL 16

Accepted Solution

Easwaran Paramasivam earned 120 total points
ID: 37795601
Save the file in a common place with unique name and store the full file path in DB. While you need it read the file. If you want to improve the performance you can use Caching technique. Please do refer
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 37795608
Each file name should be unique and the same could be use as Cache KEY.
LVL 34

Expert Comment

ID: 37805703
you might zip the file and store the zipped binary into a blob (varbinary). that would spare a lot of space and would be faster for both write and read cause zip/unzip was made in memory.


Author Closing Comment

ID: 37852344

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question