binary data datatype

We want to serialize some of our c# classes into a database column.  We are going to use binary serialization.  
What would be the best datatype to store the binary data?  Should we use varbinary(max)?  The classes are not very large and when serializing to the file system they are about 7Kb.
Any suggestions?

CREATE TABLE [dbo].[ClassTable](
      [ID] [int] NOT NULL,
      [ClassData] [varbinary](max) NOT NULL,
 CONSTRAINT [PK_ClassTable] PRIMARY KEY CLUSTERED
(
      [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
tampsystemsAsked:
Who is Participating?
 
Ephraim WangoyaConnect With a Mentor Commented:
varbinary(max) is your best bet, since you don't know before hand what size you would need in the future
0
 
tampsystemsAuthor Commented:
now what if we need to store it using text (XML), would varchar(max) be the best bet too?
0
 
jogosCommented:
If you only want to use it trough your C# it don't makes a lot of difference.

There is also the XML-datatype, but that will be slower in performance.
0
All Courses

From novice to tech pro — start learning today.