bcp文件用什么打開 如何使用SQLServer命令BCP導入導出EXCEL數(shù)據(jù)?
如何使用SQLServer命令BCP導入導出EXCEL數(shù)據(jù)?SQL server使用BCP導入和導出數(shù)據(jù)命令行:BCPpubs.dbo.table1在“d:t1.dat”-S中。-U“sa”-P“12
如何使用SQLServer命令BCP導入導出EXCEL數(shù)據(jù)?
SQL server使用BCP導入和導出數(shù)據(jù)
命令行:
BCPpubs.dbo.table1在“d:t1.dat”-S中。-U“sa”-P“123”-n
bcppubs.dbo.table1輸出“D:T1。Dat“-S.-u”SA“-P”123“-n
或調用SQL過程][SQL
]執(zhí)行主機。。XPucmdshell“bcppubs.dbo.table1在“d:t1.dat”-S中。-U“sa”-P“123”-n“http://www.2cto.com
exec master..xp_ucmdshell“bcppubs.dbo.table1輸出“D:T1。Dat“-S.-u”SA“-P”123“-n”
在sybase中怎么用bcp導入數(shù)據(jù)?
從數(shù)據(jù)庫導出所有表數(shù)據(jù):
1。編輯文件選擇輸出.sql:
設置nocount on
使用databasename
go
從sysobjects中選擇“bcp databasename..”name“out d:temp”name“.txt-Uusername-Ppassword-Sservername-c”,其中Type=“U”
go
2。在CMD中執(zhí)行:
ISQL-uusername-ppassword-sservername-id:選擇輸出.sql-外徑:bcpout.bat公司
3. 執(zhí)行D:bcpout.bat公司數(shù)據(jù)可以導出到D:tempdirectory。
將所有表數(shù)據(jù)導入數(shù)據(jù)庫時,將上面的out更改為in
4。BCP導入導出:
導出數(shù)據(jù):
BCPDatabaseName.dbo.tableName表名輸出D:表格名.txt-Sservername-USA-P-C-B 10000
導入數(shù)據(jù):
BCPDatabaseName.dbo.tableName表名在D:表格名.txt-SServerName-Usa-P-c-b導入大量數(shù)據(jù)時,會將-b參數(shù)添加到batch submit中,這樣數(shù)據(jù)庫日志將不滿。