如果五个表的表结构一样. 试试: EXEC master..xp_cmdshell 'BCP "select * from 库.dbo.表1 union all select * from 库.dbo.表2 union all select * from 库.dbo.表3 union all select * from 库.dbo.表4 union all select * from 库.dbo.表5" queryout E:\实验用数据库\sss.txt -c -S7824558CF32B4F1\SQL01 -Usa -P520520'
试试:
EXEC master..xp_cmdshell 'BCP "select * from 库.dbo.表1 union all select * from 库.dbo.表2 union all select * from 库.dbo.表3 union all select * from 库.dbo.表4 union all select * from 库.dbo.表5"
queryout E:\实验用数据库\sss.txt -c -S7824558CF32B4F1\SQL01 -Usa -P520520'