Ok, I know this question has been asked dozen of time. I did do some research but I encountered some difficulties. Please help me and I promise all the reward points that I have.
Below is my procedure :
1) I created a stored procedure with the following source from http://www.mssqlcity.com/Articles/KnowHow/Textcopy.htm
CREATE PROCEDURE sp_textcopy (
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
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
2) Then I go to SQL Query Analyser and select the database where my tables and the stored procedure located.
3) My database is called "paramount", table is 'movie' and has a field called "image" and its type is "image".
4) I issued this command :
sp_textcopy @srvname = 'local',
@login = '', @password = '',
@dbname = 'paramountSilver', @tbname = 'movie',
@colname = 'image',
@filename = 'd:\paramount\antz.jpg',
@whereclause = "title = 'antz'",
@direction = 'I'
5) I got this message from the output panel
'textcopy' is not recognized as an internal or external command,operable program or batch file.
Please tell me what is wrong and how to rectify the error.
Thank you very much.