SQLServerCentral Article

BCP Data Dynamically

,

Here is an example of how to use the sp_msforeachtable stored

procedure

to

bcp out data for each table:


use pubs
go

sp_MSforeachtable
@command1="master..xp_cmdshell 'bcp pubs.? out

c:\? /U <user name /P <password> /S <server

name> /c'"
go

For more information on sp_msforeachtable, please read the archived article.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating