RATE THIS ANSWER
0
Click to Vote:
1
-1
Last Answered:
Dec 21 2007 3:32 PM GMT
by Hank1039
You can insert data using a standard insert statement if you'd like. Most people will write a stored procedure which accepts the blob data as an input parameter and then the stored procedure will do the actual insert. You can then call the procedure from your calling application in a parameterized mode so that you don't have to write the actuall execute command.
Your stored procedure would look something like this.
CREATE PROCEDURE usp_InsertWorkDoc
@FileName nvarchar(255),
@FileData varbinary(max)
AS
INSERT INTO FileTable
(FileName, FileData)
values
(@FileName, @FileData)
GO
You will want to put some data checking to make sure that the file doesn't already exist. You'll also notice that I used the varbinary(max) data type. Word Docs are binary are as such need to be stored in a binary data type.
_______
Thanks, Hank1039