Question : Storing attachmentd in SQL Server

I have an Access 2007 database which I have upsized to SQL Server. I was using the new attachment data type for storing documents, but that doesn't seem to be available in SQL Server.

Is there another way of doing this please?

Answer : Storing attachmentd in SQL Server

SQL doesn't have such data type, but depending of the type of document that you want to store, you could use that image data type, or the xml data type. If the documents are pdfs, Word, or excel, you could also use the varbinary data type.

for example the table below can store the filename and extension in the first two columns and the file itself in the third one. Optionally

CREATE TABLE [TestTable]
(
         [ID] [int] IDENTITY(1,1) NOT NULL,
         [FileName] [nvarchar](15) NOT NULL,
         [Extension] [nvarchar](5) NOT NULL,
         [Content] [image] NULL
)

Image data type and varbinary(max) can store up to 2GB file sizes.
Random Solutions  
 
programming4us programming4us