views:

144

answers:

2

I have a User table that has all of their avatars saved in an image field. I'd like to just take that out of the database and store it as a regular file on disk.

I looked around and saw some code for textcopy, but that doesn't seem to be on my machine for some reason. Here is the code I wrote up anyway. Anyone know a way to get this done?

DECLARE @exec_str varchar (255)
SELECT @exec_str =
         'textcopy /S (local)\SQLEXPRESS' +
         --' /U ' + @login +
         --' /P ' + @password +
         ' /D thedatabase' +
         ' /T User'+
         ' /C AvatarImage' +
         ' /F "d:\Avatars\' + User.Name + '.jpg"' +
         ' /O'
FROM [User]
WHERE UserID = 2
EXEC master..xp_cmdshell @exec_str
A: 

http://msdn.microsoft.com/en-us/library/aa936933%28SQL.80%29.aspx

It says it is part of the devtools samples

Cine
Looks like that's for SQL Server 2000. I've searched the MS SQL Server files for textcopy and I don't have it.
rball
A: 

Check this thread

hallie

related questions