Header

  1. View current page

    정상혁의 수첩

Profile_img_60x60_08
195

Sybase bcp

 bcp [[database_name.]owner.]table_name[:slice_number] {in | out} datafile

 

[-m maxerrors] [-f formatfile] [-e errfile]

[-F firstrow] [-L lastrow] [-b batchsize]

[-n] [-c] [-t field_terminator] [-r row_terminator]

[-U username] [-P password] [-I interfaces_file] [-S server]

[-a display_charset] [-q datafile_charset] [-z language] [-v]

[-A packet size] [-J client character set]

[-T text or image size] [-E] [-g id_start_value] [-N] [-X]

[-M LabelName LabelValue] [-labeled]

[-K keytab_file] [-R remote_server_principal]

[-V [security_options]] [-Z security_mechanism] [-Q]


* 받기
bcp ebaidb1.ebaiusr.CM_USRINFO out usrinfo_060411.dat -SEBAIDB1 -c -Usa -Pjejudo2k

* 넣기
bcp ebaidb1.ebaiusr.CM_USRINFO in usrinfo_060411.dat -SEBAIDEV -c -Usa -P

* 일괄스크립트
use pubs2
go
select 'bcp pubs2..'+name+' out '+name+'.dat -c -Usa -P' from sysobjects where type='U'
go

select 'bcp pubs2..'+name+' in '+name+'.dat -c -Usa -P ' from sysobjects where type='U'

go


* 스크립트 실행
isql -Usa -P -ibcptest.sql -oresult.sql

* in 옵션변경

bcp out은 그냥 out을 시키시면 되지만 in은 작업을 하나 해주셔야합니다.

1>sp_dboption ebaidb1,"select into/bulkcopy",true

2>go

1>use ebaidb1

2>go

1>checkpoint

2>go

 

History

Last edited on 07/05/2007 15:58 by benelog

Comments (0)

You must log in to leave a comment. Please sign in.