CREATE TABLE test ( filename VARCHAR(255) , f_updatefiles long binary ); The column name is f_updatefiles, which is used to store some common upgrade files (such as D ll files) of LL. I want to use SQL statements to export them to the server directory, but if I use 'select f_updatefiles from' DBA '. Test'; output to D: \ 1.dll' this file will report an error The out put function can't use binary export file. The default is TXT. How to solve this problem |
I recommend the xp_write_file() function to export files, both for text and binary files. The OUTPUT command and the UNLOAD statement are primarily meant to export result sets to files. |
You can try:
select f_updatefiles from DBA.Test ># D:\1.dll
OR you can try:
unload select f_updatefiles from DBA.Test to 'D:\1.dll'
In the second case you should be connected to DB as DBA, or you should start the DB with -gl all option
Have you tested either of those, to make sure that 1.dll is in fact a binary DLL file, or a text representation of one?
Actually I did not test it, just thought about the statment itself, and not about the content of the file.
Thank you for the very nice explanation