sql文件怎么導(dǎo)入數(shù)據(jù)庫(kù) 在sybase中怎么用bcp導(dǎo)入數(shù)據(jù)?
在sybase中怎么用bcp導(dǎo)入數(shù)據(jù)?從數(shù)據(jù)庫(kù)中把所有表數(shù)據(jù)導(dǎo)出: 1.編輯一個(gè)文件selectout.sql: set nocount onuse databasenamegoselect "bcp
在sybase中怎么用bcp導(dǎo)入數(shù)據(jù)?
從數(shù)據(jù)庫(kù)中把所有表數(shù)據(jù)導(dǎo)出:
1.編輯一個(gè)文件selectout.sql:
set nocount on
use databasename
go
select "bcp databasename.." name " out d:temp" name ".txt -Uusername -Ppassword -Sservername -c " from sysobjects where type="U"
go
2.在cmd中執(zhí)行:
isql -Uusername -Ppassword -Sservername -i d:selectout.sql -o d:bcpout.bat
3.執(zhí)行d:bcpout.bat文件, 可以把數(shù)據(jù)導(dǎo)出到d:temp目錄。
把所有表數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫(kù)時(shí),將上面的out改為in
4.bcp導(dǎo)入導(dǎo)出:
導(dǎo)出數(shù)據(jù):
bcp DatabaseName.dbo.tableName out D:tableName.txt -SServerName -Usa -P -c -b 10000
導(dǎo)入數(shù)據(jù):
bcp DatabaseName.dbo.tableName in D:tableName.txt -SServerName -Usa -P -c -b 10000
在導(dǎo)入大量數(shù)據(jù)時(shí)加上-b參數(shù),分批提交不以致于數(shù)據(jù)庫(kù)日志被塞滿。
如何將.bcp文件中的數(shù)據(jù)導(dǎo)入到Oracle數(shù)據(jù)庫(kù)表格中?
導(dǎo)出數(shù)據(jù)庫(kù)命令: mysqldump -u root -p mydb2 > e:mydb.sql 把數(shù)據(jù)庫(kù)mydb2導(dǎo)出到e盤的mydb.sql 注意:在dos下進(jìn)入mysql安裝的bin目錄下,但是不要登陸。 導(dǎo)入數(shù)據(jù)庫(kù)命令: mysqldump -u root -p mydb2
如何使用SQLServer命令BCP導(dǎo)入導(dǎo)出EXCEL數(shù)據(jù)?
SQL Server使用BCP導(dǎo)入導(dǎo)出數(shù)據(jù)
命令行下:
bcp pubs.dbo.table1 in "d:t1.dat" -S . -U "sa" -P "123" -n
bcp pubs.dbo.table1 out "d:t1.dat" -S . -U "sa" -P "123" -n
或調(diào)用SQL過程
[sql]
exec master..xp_cmdshell "bcp pubs.dbo.table1 in "d:t1.dat" -S . -U "sa" -P "123" -n" http://www.2cto.com
exec master..xp_cmdshell "bcp pubs.dbo.table1 out "d:t1.dat" -S . -U "sa" -P "123" -n"