Hello

I'm trying to insert a Word Dcument into a table on SQL Server 2000 using TEXTCOPY, but it gives me an error. When I use the same command to insert a graphic file e.g. bmps / jpgs etc. it is fine

Any help much appreciated

My code:

spTextcopy @srvname = 'MYSERVER',
@login = 'sa',
@password = 'PASSWORD',
@dbname = 'DBNAME',
@tbname = 'tblTest',
@colname = 'myTextCol',
@filename = 'C:\MYDOC.DOC',
@whereclause = " WHERE myid = 1 ",
@direction = 'I


CREATE PROCEDURE spTextcopy
(
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1)
)

AS

DECLARE @exec_str varchar (255)

SELECT @exec_str =
'textcopy /S ' + @srvname +
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction

EXEC master..xp_cmdshell @exec_str