Question

  Asked: Jun 13 2008   3:18 PM GMT
  Asked by: SQL Server Ask the Experts


Storing attachments in tables on SQL Server 2005


SQL Server 2005, .NET, SQL Server migration

I am new on .NET and plan to migrate some applications to this new environment. I have a simple question – on SQL 2005, can you store attachments inside of tables?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Yes you can. In SQL 2005 you will want to store the files within a column of the type VARBINARY(MAX). This will allow for up to 2 Gigs of data per record within that field.

However it is recommend that you not store files within the SQL Table. Instead store the file outside of the database, and store only the path to the file within the database. Using this method will greatly increase your system performance over storing the data within the database.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server and Development.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   Jun 13 2008  5:24PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.