• Depending on your GUI (web app, VB app, etc) the methods will vary.  For example, in an ASP web app you could use Persits ASPUpload (if available) or some other code that uses an <input type=file> control on your web form to upload the file.  If using VB, you can use an ADO Stream object to read the contents of the file.  Regardless of how you get the file contents, you can then write a stored procedure that basically just does an INSERT.  Below is an example of how I am storing files (in tblFile) and the ADD stored procedure for that table.

    tblFile

    FileID        int (identity)

    FileNM        varchar(255)

    SizeDM        bigint

    ContentTypeID varchar(100)

    UploadDT      smalldatetime

    ContentBD     image

    ExtensionCD   varchar(3)  (computed as right([FileNM],3))

    CREATE PROCEDURE dbo.procFile_ADD

     @FileNM        varchar(255),

     @SizeDM        bigint,

     @ContentTypeID varchar(100),

     @ContentBD     image  = NULL,

     @FileID        int OUTPUT

    AS

    SET NOCOUNT ON

    BEGIN

      INSERT INTO tblFile (FileNM, SizeDM, ContentTypeID, UploadDT, ContentBD)

                   VALUES (@FileNM, @SizeDM, @ContentTypeID, GETDATE(), @ContentBD)

      SET @FileID = @@IDENTITY

    END