BCP Data Dynamically

, 2001-06-15

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

Share

Share

Rate

Related content