SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


data export


data export

Author
Message
rightontarget
rightontarget
SSC Veteran
SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)

Group: General Forum Members
Points: 245 Visits: 468
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,
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCrazy Eights
SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)SSCrazy Eights (8.9K reputation)

Group: General Forum Members
Points: 8929 Visits: 7281
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”
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search