April 21, 2008 at 3:41 am
Hi,
has someone an idea, how to save a varbinary with xp_cmdshell?
I try the following:
DECLARE @cmd sysname;
DECLARE @blob varbinary;
select @blob=datei from person.address where addressid=1;
SET @cmd = 'copy ' + @blob + '' C:\test.doc''
EXEC master..xp_cmdshell @cmd;
the variable @blob contains an doc-file.
regards martin
April 21, 2008 at 6:33 am
You can use the below query to take the varbinary output to a file.
Exec master.dbo.xp_cmdshell 'osql -E -S. -Q"select datei from person.address where addressid=1" -o"C:\test.doc" -ddatabasename'
Regards..Vidhya Sagar
SQL-Articles
April 21, 2008 at 12:42 pm
hi, thank you for your reply:
I tried the following:
Exec master.dbo.xp_cmdshell 'osql -E -S. -Q"select datei from person.address where addressid=1" -o"C:\test.doc" -d"AdventureWorks"'
But when i look into the doc-file: the content is the columnname "Datei" and not the content of the column
do you have another suggestion?
regards
martin
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply