Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

data export Expand / Collapse
Author
Message
Posted Friday, November 9, 2012 1:04 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 12:37 PM
Points: 100, Visits: 336
Hi all,
What is the best (fastest) way to export data into a flat file if one of the columns is varbinary(max)?
I am trying the following:

DECLARE @table VARCHAR(128),
@file VARCHAR(255),
@cmd VARCHAR(512)

SET @file = 'C:\temp\' + @db_in + '.' + @schema_in + '.' + @table_in + '.dat'
SET @cmd = 'bcp ' + @db_in + '.' + @schema_in + '.' + @table_in + ' out ' + @file + ' -n -T '
EXEC master..xp_cmdshell @cmd
END

but it is taking some time and I am suspecting BLOB column being the offender.
Is there another way?

Thanks,
Post #1383213
Posted Tuesday, November 13, 2012 7:38 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 4:22 AM
Points: 3,868, Visits: 5,022
First of all, is it really neccessary to export the BLOB column to a flat file? this will be huge.
an alternative is to use SSIS...


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1384098
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse