Create intelligent datatype using .NET

  • In my database there's a table called document which contains a varbinary(max) field. Because we are dealing with large pieces of data, my application rarely uses this field but stores data as encrypted files in a file directory (it is used though).

    File access is done through my application and I got an idea that I would like you guys to comment on:

    Can I create a data type based on varbinary in .NET which apparently works exactly the same but underneath stores and fetches data from files? The datatype should be attached the database, not the server because our customers sometimes use server hotels. The type should be able to contain data if needed.

    With extended properties I could set the directory path, control threshold size for external storage and disable the functionality and store data in the field.

    This is my idea. Is it possible? Any alternatives?

    /hrc

  • It sounds to me like the best fit for your problem would be to use FILESTREAM storage for your VARBINARY(MAX) field. You might want to look that up in BOL.

  • You right. Learned about filestreams as late as yesterday, but alas, I cannot use it as the customers heavily rely on SQL2005 and streams is a 2008 thing.

    In time they'll all upgrade and then I'll be ready to support it. Thanks for the reply.

  • hrc (9/29/2010)


    You right. Learned about filestreams as late as yesterday, but alas, I cannot use it as the customers heavily rely on SQL2005 and streams is a 2008 thing.

    You did post in a 2008 forum, so I assumed you were asking about 2008. 😀

  • Right again. Should have posted in the 2005-section. Didn't expect the post to point at filestreams.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply