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
Posted Friday, November 9, 2012 1:04 PM


Group: General Forum Members
Last Login: Wednesday, September 17, 2014 10:42 AM
Points: 102, Visits: 346
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

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

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 @ 10:56 AM
Points: 3,986, Visits: 5,243
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