闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閹冣挃闁硅櫕鎹囬垾鏃堝礃椤忎礁浜鹃柨婵嗙凹缁ㄥジ鏌熼惂鍝ョМ闁哄矉缍侀、姗€鎮欓幖顓燁棧闂備線娼уΛ娆戞暜閹烘缍栨繝闈涱儐閺呮煡鏌涘☉鍗炲妞ゃ儲鑹鹃埞鎴炲箠闁稿﹥顨嗛幈銊╂倻閽樺锛涢梺缁樺姉閸庛倝宕戠€n喗鐓熸俊顖濆吹濠€浠嬫煃瑜滈崗娑氭濮橆剦鍤曢柟缁㈠枛椤懘鏌eΟ鑽ゅ灩闁搞儯鍔庨崢閬嶆煟韫囨洖浠滃褌绮欓幃锟狀敍濮樿偐鍞甸柣鐔哥懃鐎氼厾绮堥埀顒勬⒑鐎圭媭娼愰柛銊ユ健閵嗕礁鈻庨幋鐘碉紲闂佽鍎虫晶搴g玻濡ゅ懏鈷掑ù锝呮啞閸熺偞銇勯鐐搭棦鐎规洘锕㈤弫鎰板幢濞嗗苯浜炬繛宸簼閸婂灚顨ラ悙鑼虎闁告梹纰嶇换娑㈡嚑椤掆偓閳诲牏鈧娲橀崹鍧楃嵁濮椻偓閹虫粓妫冨☉娆戔偓顓㈡⒒娴e憡鍟炴繛璇х畵瀹曟粌鈽夐埗鍝勬喘椤㈡﹢鎮㈤搹鍦闂備礁鍟块惃婵嬪磻閹剧粯鐓曢柡鍥╁仧娴犳盯鏌i妶鍕槮閾绘牠鏌e鈧ḿ褎绂掑⿰鍕箚妞ゆ劧绲跨粻鎾淬亜閺囶亞绉い銏″哺閸┾偓妞ゆ巻鍋撻柣锝囧厴閹剝鎯旈鎯ф暩婵$偑鍊曠换瀣倿閿曗偓閳诲秵绻濋崶銊у幍濡炪倖姊婚悺鏂库枔濠婂牊鐓涘ù锝囨嚀婵牓鏌熼娑欑叆闁宠鍨垮畷鐓庘攽閸℃ḿ妲楅梻鍌欐祰椤曆兠归悜钘夌疇闁规崘顕х粻鐔兼煥濞戞ê顏€规洘鐓¢弻娑㈠即閵娿儱绠哄銈庡亝濞茬喖寮婚悢鍏煎€绘俊顖濐嚙闂夊秶绱撻崒姘毙㈡繛宸弮瀵寮撮悢铏诡啎闂佸壊鐓堥崰鏍ㄦ叏閵忋倖鈷戦柤濮愬€曢弸鍌炴煕閺傝法鐒搁柍銉︽瀹曟﹢顢欓崲澹洤绠圭紒顔煎帨閸嬫捇鎳犻鈧崵顒傜磽閸屾艾鈧娆㈤敓鐘茬獥婵°倕鎳庣粻浼存煙闂傚鍔嶉柛瀣ф櫊閺岋綁骞嬮敐鍡╂缂佺虎鍘搁崑鎾绘⒒娴h櫣甯涢柛鏃€娲滅划鏃堝醇閺囩偟鐛ラ梺鍝勭▉閸樿偐绮婚弽銊х闁糕剝蓱鐏忣厾绱掗悪鍛ɑ缂佺粯绻堝Λ鍐ㄢ槈濞嗘劖鍊锋俊鐐€ч懙褰掑疾閻樺樊娼栨繛宸簻缁狀噣鏌ら幁鎺戝姕闁哄棛濞€濮婃椽骞栭悙鎻掝瀳濠电姭鍋撻柛妤冨€i敐澶婄疀闁哄娉曢鎺楁煟鎼淬垻鈯曢柨姘亜鎼淬垺灏扮紒缁樼箓閳绘捇宕归鐣屼憾闂備胶纭堕弲娑㈡偋婵犲嫮鐭夌€广儱鎳夐弨浠嬫倵閿濆簼绨介柣銈呭濮婃椽妫冨ù銉ョ墦瀵彃鈽夐姀鈥斥偓宄扳攽閻樺弶澶勯柣鎾崇箰閳规垿鎮欓懠顑胯檸闂侀€炲苯澧い銊ョ墢閸掓帞鎷犲顔藉兊濡炪倖甯掗ˇ鎵偓闈涚焸濮婃椽妫冨☉姘暫濠碘槅鍋呯粙鎺楀疾閸洦鏁嗛柛鏇ㄥ墰閸樹粙姊洪崫鍕殲闁搞劌鐏氶弲鍫曞箻椤旂晫鍘介梺鐟扮仢閸燁偅鏅剁€涙ǜ浜滈柕蹇婃濞堟粎鈧娲樼敮鎺曠亙闂侀€炲苯澧紒鍌氱У閵堬綁宕橀埡浣风敾婵犵數鍋涘Λ妤冩崲閹伴偊鏁傛い蹇撴濡垶鏌i幇闈涘闁稿﹥鍔欓弻锛勪沪閸撗€濮囬梺璇″灡濡啴寮幇鏉垮耿婵☆垵宕靛Σ妤呮⒑鐠囨彃顒㈡い鏃€鐗犲畷鎶筋敋閳ь剙鐣烽幋鐐电瘈闁搞儮鏅涚粊锕€鈹戦埥鍡楃仴闁稿鍔楁竟鏇㈠礂闂傚绠氬銈嗙墬缁海鏁☉娆嶄簻闊洦娲栭弸娑欐叏婵犲嫮甯涢柟宄版嚇閹崇偤濡疯閳ь剙锕娲閳哄啰肖缂備胶濮甸幑鍥偘椤旇法鐤€婵炴垶鐟﹀▍銏ゆ⒑鐠恒劌娅愰柟鍑ゆ嫹濠电姷鏁告慨鐑藉极閸涘﹥鍙忛柣鎴f閺嬩線鏌涘☉姗堟敾闁告瑥绻橀弻锝夊箣閿濆棭妫勯梺鍝勵儎缁舵岸寮诲☉妯锋婵鐗婇弫楣冩⒑閸涘﹦鎳冪紒缁橈耿瀵鏁愭径濠勵吅闂佹寧绻傚Λ顓炍涢崟顖涒拺闁告繂瀚烽崕搴g磼閼搁潧鍝虹€殿喖顭烽幃銏ゅ礂鐏忔牗瀚介梺璇查叄濞佳勭珶婵犲伣锝夘敊閸撗咃紲闂佺粯鍔﹂崜娆撳礉閵堝棎浜滄い鎾跺Т閸樺鈧鍠栭…鐑藉极閹邦厼绶炲┑鐘插閺夊憡淇婇悙顏勨偓鏍暜婵犲洦鍊块柨鏇炲€哥壕鍧楁煙閹冾暢缁炬崘妫勯湁闁挎繂鎳忛幆鍫焊韫囨稒鈷戦柛娑樷看濞堟洖鈹戦悙璇у伐妞ゆ洩绲剧换婵嗩潩椤撶偘绨婚梻浣呵圭换鎰版儍閻戣棄绠┑鐘崇閻撶喖骞栧ǎ顒€濡芥繛鎳峰喚鐔嗛柣鐔峰簻瀹搞儵宕℃潏銊d簻闁哄倸鐏濋埛鏃傜棯閹规劖顥夐棁澶愭煥濠靛棙鍣洪柟顖氱墦瀹曨垶骞栨担鍏夋嫼闂佸憡绺块崕杈ㄧ墡闂備胶绮〃鍫熸叏閹绢噮鏁嬮柨婵嗘缁♀偓濠殿喗锕╅崕鐢稿煛閸涱喚鍘撻梺鍛婄箓鐎氼剟鍩€椤掆偓閹诧紕绮嬪鍛牚闁割偆鍟块幏娲⒑閸涘﹦鈽夐柨鏇缁骞樼紒妯衡偓鍨叏濮楀棗澧柛銈呮搐閳规垿顢欓悷棰佸闂傚倷绶氬ḿ褔鎮ч崱妞㈡稑鈽夐姀鐘插亶闂備緡鍓欑粔鐢稿煕閹达附鈷掗柛顐ゅ枙閸庢劗鎲搁悧鍫濈瑨缁炬儳娼″娲敆閳ь剛绮旈幘顔藉€块柛顭戝亖娴滄粓鏌熼崫鍕棞濞存粍鍎抽埞鎴︽偐椤愵澀澹曢梻鍌欑贰閸撴瑧绮旂€靛摜涓嶉柡灞诲劜閻撳繘鐓崶銊︾鐞氥儱鈹戦埄鍐ㄧ祷闁绘鎹囧濠氬即閿涘嫮鏉搁梺鍝勬川閸婎偊濮€閵堝棛鍘鹃梺鍝勵槼濞夋洘绂掗姀銈嗙厓閻熸瑥瀚悘鎾煕閳瑰灝鍔︾€规洖宕灃闁告剬鍕枙婵犵绱曢崑鎴﹀磹閺嵮€鏋栭柨鏇炲€搁悙濠冦亜椤撶喎鐏︽い銉ヮ樀閺岋絾鎯旈敍鍕殯闂佺ǹ閰f禍鎯版婵炴潙鍚嬪ḿ娆撴偂閺囥垺鐓欓悗鐢登瑰暩缂佺偓鍎抽妶鎼佸箖濡ゅ懏鏅查幖绮光偓鑼跺焻闂備胶枪缁ㄦ椽宕曢悽绋胯摕婵炴垶鐟﹂崕鐔兼煏韫囨洖孝妞ゎ偄娴风槐鎾存媴娴犲鎽甸柣銏╁灣閸嬨倝鐛箛娑欏亹閻犲洩灏欓宀勬⒑閸︻厼鍔嬮柟绋款煼椤㈡瑩骞掗幋鏃€鏂€闂佺粯蓱椤旀牠寮冲⿰鍛<閺夊牄鍔嶇粈瀣偓娈垮櫘閸嬪棝骞忛悩缁樺殤妞ゆ帊鐒﹂鏇㈡⒒娴h櫣甯涙慨濠傤煼閸╂盯宕奸妷銉︾€悗骞垮劚濡瑩宕h箛鏂剧箚妞ゆ牗鍝庢禒鎺楁煕濮樼厧浜伴柡灞稿墲瀵板嫮鈧綆鍋勯埀顒佸姈閹便劍绻濋崟顓炵闂佺懓鍢查幊妯虹暦椤愶箑唯闁挎棃鏁崑鎾活敊鐏忔牗鏂€闂佹枼鏅涢崯銊︾閻樼粯鐓曢柡鍌氭健閸欏嫭顨ラ悙鑼闁逞屽墾缂嶅棝宕伴弽顓熷珔闁绘柨鍚嬮悡蹇擃熆鐠鸿櫣澧曢柛鏂诲€濋弻銊モ槈濞嗘垶鍒涘┑顔硷龚濞咃綁骞夐幘顔肩妞ゆ劑鍊ゅΣ鐗堜繆閻愵亜鈧牕鈻旈敃鍌氱倞鐟滃繘藝閵娾晜鈷戦梺顐ゅ仜閼活垱鏅堕幘顔界厵妞ゆ梻鍘уΣ缁橆殰椤忓啫宓嗙€规洘锕㈤幃娆擃敄閼恒儳鈧即姊虹拠鎻掝劉妞ゆ梹鐗犲畷鏉课旈崨顓犵暫闂佺ǹ鏈崙褰掑吹閺囩喆浜滈柡鍥殔娴滈箖鎮楃憴鍕闁靛牊鎮傞獮鍐閵堝懍绱堕梺鍛婃处閸嬪懏娼忛崼銉︹拻闁稿本鑹鹃埀顒傚厴閹虫宕滄担绋跨亰濡炪倖鐗楅銏犆洪鍕敤濡炪倖鎸鹃崑鐔兼晬濞嗘挻鈷戦梻鍫氭櫅閻︽粓鏌涘Ο缁樺€愮€规洘鍨块獮姗€骞囨担鐟板厞闂備胶绮崝锕傚礈濞嗘搩鏁傞柨鐕傛嫹
开发学院数据库Sybase usage of bcp command.(快来看)。 阅读

usage of bcp command.(快来看)。

 2006-04-14 23:13:11 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閹冣挃闁硅櫕鎹囬垾鏃堝礃椤忎礁浜鹃柨婵嗙凹缁ㄧ粯銇勯幒瀣仾闁靛洤瀚伴獮鍥敍濮f寧鎹囬弻鐔哥瑹閸喖顬堝銈庡亝缁挸鐣烽崡鐐嶆棃鍩€椤掑嫮宓佸┑鐘插绾句粙鏌涚仦鎹愬闁逞屽墰閹虫捇锝炲┑瀣╅柍杞拌兌閻ゅ懐绱撴担鍓插剱妞ゆ垶鐟╁畷銉р偓锝庡枟閻撴洘銇勯幇闈涗簼缂佽埖姘ㄧ槐鎾诲礃閳哄倻顦板┑顔硷工椤嘲鐣烽幒鎴旀瀻闁规惌鍘借ⅵ濠电姷鏁告慨顓㈠磻閹剧粯鈷戞い鎺嗗亾缂佸鏁婚獮鍡涙倷閸濆嫮顔愬┑鐑囩秵閸撴瑦淇婇懖鈺冪<闁归偊鍙庡▓婊堟煛鐏炵硶鍋撻幇浣告倯闁硅偐琛ラ埀顒冨皺閺佹牕鈹戦悙鏉戠仸闁圭ǹ鎽滅划鏃堟偨缁嬭锕傛煕閺囥劌鐏犻柛鎰ㄥ亾婵$偑鍊栭崝锕€顭块埀顒佺箾瀹€濠侀偗婵﹨娅g槐鎺懳熺拠鑼舵暱闂備胶枪濞寸兘寮拠宸殨濠电姵纰嶉弲鎻掝熆鐠虹尨宸ョ€规挸妫濆铏圭磼濡搫顫嶇紓浣风劍閹稿啿鐣烽幋锕€绠婚悹鍥у级瀹撳秴顪冮妶鍡樺鞍缂佸鍨剁粋宥夋倷椤掍礁寮垮┑鈽嗗灣閸樠勭妤e啯鍊垫慨妯煎亾鐎氾拷闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閹冣挃闁硅櫕鎹囬垾鏃堝礃椤忎礁浜鹃柨婵嗙凹缁ㄥジ鏌熼惂鍝ョМ闁哄矉缍侀、姗€鎮欓幖顓燁棧闂備線娼уΛ娆戞暜閹烘缍栨繝闈涱儐閺呮煡鏌涘☉鍗炲妞ゃ儲鑹鹃埞鎴炲箠闁稿﹥顨嗛幈銊╂倻閽樺锛涘┑鐐村灍閹崇偤宕堕浣镐缓缂備礁顑嗙€笛囨倵椤掑嫭鈷戦柣鐔告緲閳锋梻绱掗鍛仸鐎规洘鍨块獮鍥偋閸垹骞嶇紓鍌氬€烽悞锕傛晪缂備焦銇嗛崶銊у帗閻熸粍绮撳畷婊堟晝閸屾氨鐓戦梺鍛婂姦閻撳牆岣块弽顓熺厱婵犻潧妫楅悵鏃傛喐閺傝法鏆﹂柟顖炲亰濡茬偓绻涚€电ǹ孝闁靛牏枪椤繘鎼圭憴鍕彴闂佽偐鈷堥崜娑㈩敊婢舵劖鈷戦柣鎾虫捣缁夎櫣绱掗悩宕囧⒌妤犵偛鍟妶锝夊礃閳轰讲鍋撴繝姘參婵☆垯璀﹀Σ濂告煙閼恒儲绀嬫慨濠冩そ濡啫鈽夋潏顭戔偓鍡樼節绾版ǚ鍋撻搹顐㈡灎閻庤娲忛崹浠嬪箖娴犲宸濆┑鐐靛亾鐎氬ジ姊洪懡銈呮瀾闁荤喆鍎抽埀顒佹皑閸忔ê鐣烽婵堢杸婵炴垶鐟ч崢閬嶆⒑缂佹◤顏嗗椤撶喐娅犻柣銏犳啞閻撳繘鏌涢埄鍐炬當闁逞屽墮濠€杈╃磽閹惧顩烽悗锝庝簻缁愭稒绻濋悽闈浶㈤悗姘煎墴閻涱噣宕奸妷锔规嫼缂佺虎鍘奸幊搴ㄋ夊澶嬬厵婵炶尪顔婄花鑺ヤ繆閸欏濮嶇€殿喗鎸抽幃銏ゅ传閸曘劌褰忛梻鍌氬€搁崐鎼佸磹妞嬪孩顐芥慨姗嗗厳缂傛氨鎲稿鍥у疾闂備線娼ч悧鍡椕洪悩璇茬;闁圭偓鍓氬ḿ鈺傘亜閹扳晛鐏╃紒渚囧櫍濮婅櫣绱掑Ο鍦箒闂侀潻缍囩紞渚€鎮伴鈧獮鎺楀箠閾忣偅顥堥柛鈹惧亾濡炪倖甯掗崐缁樼▔瀹ュ鐓ユ繝闈涙椤ョ姷绱掗埦鈧崑鎾绘⒒閸屾艾鈧悂鎮ф繝鍕煓闁硅揪绠戝Ч鍙夌箾閸℃璐╅柣鐔稿閸亪鏌涢鐘茬伄闁哄棭鍋婂娲传閸曨厾鍔圭紓鍌氱С閻掞箓骞堥妸鈺佺劦妞ゆ帒瀚悡鍐煙椤栨粌顣肩痪顓犲亾缁绘繈鍩€椤掍焦缍囬柕濞у懎楠勯梻浣告惈濞层劑宕伴幘璺哄К闁逞屽墮閳规垿顢欓弬銈勭返闂佸憡锕㈢粻鏍х暦閵忋倖鍋ㄩ柛娑樑堥幏铏圭磽閸屾瑧鍔嶉柨姘攽椤曞棛鐣甸柡灞剧洴楠炴﹢寮堕幋婵囨嚈闂備浇顕栭崰妤勬懌濠电偟鍘х换妯讳繆閹间礁围闁搞儮鏅濋弳浼存⒒閸屾瑧顦︽繝鈧潏鈺佸灊妞ゆ牗绮嶉弳婊堟煟閹邦剛鎽犳繛鍛У缁绘盯骞嬮悙瀵告缂佺偓宕橀崑鎰閹惧瓨濯撮悹鎰靛灣缁辨澘鈹戦悙鏉戠祷妞ゆ洦鍙冮崺鈧い鎺戝枤濞兼劖绻涢崣澶屽ⅹ闁伙絿鍏橀、妤呭礃椤忓啰鑳洪梻鍌氬€风粈渚€骞夐敓鐘茬闁哄洢鍨归悿顕€鏌eΟ娆惧殭缂佲偓閸喓绡€闂傚牊绋撴晶娑氣偓瑙勬礀瀵墎鎹㈠☉銏犵闁绘劑鍔庣槐浼存⒑閸濆嫭顥滄俊顐n殜閸╃偤骞嬮敂钘変汗闁哄鐗滈崑鍕储閿熺姵鈷戦弶鐐村閸斿秹鏌eΔ浣虹煂婵″弶鍔欓獮妯尖偓娑櫭鎾寸箾鐎电ǹ孝妞ゆ垵鎳橀獮妤呮偨閸涘ň鎷洪梺闈╁瘜閸樹粙宕甸埀顒€鈹戦悙鑼勾闁稿﹥绻堥獮鍐┿偅閸愨晛鈧鏌﹀Ο渚Ш妞ゆ柨锕铏规喆閸曨剙鍓归梺鍛娒肩划娆忕暦閹剧粯鍋ㄩ柛娑樑堥幏娲⒑閼姐倕鏋戞繝銏★耿楠炲啯绗熼埀顒勫蓟閿濆绠抽柣鎰暩閺嗐倝姊虹拠鈥虫灍妞ゃ劌锕悰顕€寮介妸锕€顎撻梺绋跨箰椤︽壆鈧俺妫勯埞鎴︽倷閼搁潧娑х紓浣瑰絻濞尖€崇暦閺囥垹围濠㈣泛锕ら幆鐐烘⒑闁偛鑻晶瀛樻叏婵犲啯銇濇鐐寸墵閹瑥霉鐎n亙澹曢梺鍝勭▉閸樹粙宕戠€n喗鐓熸俊顖氱仢閸氬湱鈧鎸风欢姘舵偂椤愶箑鐐婇柕濞р偓婵洭姊洪崫鍕櫤闁诡喖鍊垮濠氬Ω閳哄倸浜為梺绋挎湰缁嬫垿顢旈敓锟�婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柛娑橈攻閸欏繘鏌i幋锝嗩棄闁哄绶氶弻娑樷槈濮楀牊鏁鹃梺鍛婄懃缁绘﹢寮婚敐澶婄闁挎繂妫Λ鍕⒑閸濆嫷鍎庣紒鑸靛哺瀵鈽夊Ο閿嬵潔濠殿喗顨呴悧濠囧极妤e啯鈷戦柛娑橈功閹冲啰绱掔紒妯虹伌濠碉紕鏁诲畷鐔碱敍濮橀硸鍟嬮梻浣告啞椤ㄥ牓宕戦悢鍝ヮ浄闁兼祴鏅濈壕钘壝归敐鍛儓妞ゅ骸鐭傞弻娑㈠Ω閵壯冪厽閻庢鍠涢褔鍩ユ径鎰潊闁绘ḿ鏁搁弶鎼佹⒒閸屾艾鈧悂鎮ф繝鍕煓闁圭儤顨嗛崐鍫曟煕椤愮姴鍔滈柛濠勬暬閺岋綁鎮㈤崫鍕垫毉闂佸摜鍠撻崑鐔烘閹烘梹瀚氶柟缁樺笚濞堢粯绻濈喊澶岀?闁轰浇顕ч悾鐑芥偄绾拌鲸鏅┑顔斤耿绾悂宕€n喗鈷戦悹鍥ㄧ叀閸欏嫭绻涙担鍐叉搐缁犵儤绻濇繝鍌滃闁稿鏅涢埞鎴﹀磼濮橆厼鏆堥梺鎶芥敱閸ㄥ綊鎯€椤忓牜鏁囬柣鎰綑椤庢稑鈹戦悙鎻掓倯闁告梹鐗滈幑銏犫槈閵忊€虫濡炪倖宸婚崑鎾绘煛鐎n亜顒㈤柕鍥у椤㈡洟濮€閵忋埄鍞虹紓鍌欐祰妞村摜鏁幒鏇犱航闂備礁鍚嬬粊鎾疾濠婂牆鍚圭€光偓閸曨兘鎷绘繛鎾村焹閸嬫捇鏌嶈閸撴盯宕戝☉銏″殣妞ゆ牗绋掑▍鐘炽亜閺冨洤浜归柡鍡楁閺屻劌鈹戦崱娆忣暫闂佸憡鏌ㄩ悘姘跺Φ閸曨垱鏅滈柣锝呰嫰瀵劑姊虹拠鈥虫珯缂佺粯绻冩穱濠囨嚋闂堟稓绐為柣搴秵閸撴瑧鏁ィ鍐┾拻濞达絿枪椤ュ繘鏌涚€n亝鍣介柟骞垮灲瀹曟﹢顢欓懖鈺嬬幢婵$偑鍊曠换鎰板箠閹邦喚涓嶉柛鎾椻偓閸嬫捇鎮烽弶娆炬闂佸摜濮靛ú婊堟嚍鏉堛劎绡€婵﹩鍓涢悾楣冩⒑缂佹ɑ鐓ラ柛姘儔閸╂盯骞嬮敂钘夆偓鐢告煕閿旇骞栭弽锟犳⒑闂堟稒顥滈柛鐔告尦瀵濡舵径濠勵槰闂佽偐鈷堥崜娆撴偂閻斿吋鍊甸悷娆忓缁€鍐磼鐠囪尙澧︾€殿噮鍋婂畷姗€顢欓懖鈺佸Е婵$偑鍊栫敮鎺斺偓姘€鍥х劦妞ゆ帊鐒﹂ˉ鍫⑩偓瑙勬礃閿曘垽銆佸▎鎾冲簥濠㈣鍨板ú锕傛偂閺囥垺鐓冮柍杞扮閺嬨倖绻涢崼鐕傝€块柡宀嬬秮閹垻绮欓崹顕呮綒婵犳鍠栭敃銉ヮ渻娴犲绠栭柍鈺佸暞閸庣喖鏌嶉埡浣告殲闁伙讣缍佸缁樻媴閾忕懓绗¢梺缁橆殕濞茬喐淇婇崜浣虹煓閻犳亽鍔嶅▓楣冩⒑缂佹ê鐏﹀畝锝堟硶瀵囧焵椤掑嫭鈷戦柟鑲╁仜閸斺偓闂佸憡鍔戦崝搴ㄥΧ椤曗偓濮婂宕掑▎鎴犵崲濠电偘鍖犻崟鍨啍闂婎偄娲﹀ú姗€锝為弴銏$厸闁搞儯鍎遍悘鈺呮煕鐏炶濡介柕鍥у缁犳盯骞樼捄渚澑闂備焦濞婇弨閬嶅垂閸ф钃熼柣鏂垮悑閸ゅ啴鏌嶆潪鐗堫樂缂侇喖鐖煎娲川婵犲啠鎷瑰銈冨妼閿曨亜顕f繝姘櫢闁绘ɑ褰冪粣娑橆渻閵堝棙顥堥柡渚囧枟閹便劑宕堕埡鍐紳婵炶揪绲挎灙闁逞屽墮濠€閬嶅极椤曗偓閹垺淇婇幘铏窛闁逞屽墴濞佳囧箺濠婂懎顥氬┑鍌溓圭痪褔鏌涢锝団槈濠德ゅ亹缁辨帒螖娴d警鏆$紓浣虹帛閻╊垶骞冮埄鍐╁劅闁挎繂娴傞崯瀣⒒娴h櫣銆婇柡鍌欑窔瀹曟粌鈹戠€n亞顔嗛梺鍛婄☉閻°劑鎮¢妷鈺傚€甸柨婵嗘噽娴犳稓绱撳鍡╂疁婵﹤顭峰畷鎺戭潩椤戣棄浜剧€瑰嫭鍣磋ぐ鎺戠倞鐟滄粌霉閺嶎厽鐓忓┑鐐靛亾濞呭棝鏌涙繝鍌涘仴闁哄被鍔戝鎾倷濞村浜鹃柛婵勫劤娑撳秹鏌$仦璇插姕闁绘挻娲熼弻鏇熷緞濡儤鐏堟繝鈷€灞芥珝闁哄矉绱曢埀顒婄岛閺呮繄绮i弮鍫熺厸鐎光偓閳ь剟宕伴弽褏鏆︽繝濠傛-濡查箖鏌i姀鈺佺仭闁烩晩鍨跺濠氭晸閻樻彃绐涘銈嗘濡嫰鍩€椤掍礁濮嶉柡宀嬬磿娴狅妇鎷犻幓鎺濇綆闂備浇顕栭崰鎾诲磹濠靛棛鏆﹂柟鐑樺灍濡插牊鎱ㄥΔ鈧Λ鏃傛閿燂拷闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閹冣挃闁硅櫕鎹囬垾鏃堝礃椤忎礁浜鹃柨婵嗙凹缁ㄧ粯銇勯幒瀣仾闁靛洤瀚伴獮鍥敍濮f寧鎹囬弻鐔哥瑹閸喖顬堝銈庡亝缁挸鐣烽崡鐐嶆棃鍩€椤掑嫮宓佸┑鐘插绾句粙鏌涚仦鎹愬闁逞屽墰閹虫捇锝炲┑瀣╅柍杞拌兌閻ゅ懐绱撴担鍓插剱妞ゆ垶鐟╁畷銉р偓锝庡枟閻撴洘銇勯幇闈涗簼缂佽埖姘ㄧ槐鎾诲礃閳哄倻顦板┑顔硷工椤嘲鐣烽幒鎴旀瀻闁规惌鍘借ⅵ濠电姷鏁告慨顓㈠磻閹剧粯鈷戞い鎺嗗亾缂佸鏁婚獮鍡涙倷閸濆嫮顔愬┑鐑囩秵閸撴瑦淇婇懖鈺冪<闁归偊鍙庡▓婊堟煛鐏炵硶鍋撻幇浣告倯闁硅偐琛ラ埀顒冨皺閺佹牕鈹戦悙鏉戠仸闁圭ǹ鎽滅划鏃堟偨缁嬭锕傛煕閺囥劌鐏犻柛鎰ㄥ亾婵$偑鍊栭崝锕€顭块埀顒佺箾瀹€濠侀偗婵﹨娅g槐鎺懳熺拠鑼舵暱闂備胶枪濞寸兘寮拠宸殨濠电姵纰嶉弲鎻掝熆鐠虹尨宸ョ€规挸妫濆铏圭磼濡搫顫嶇紓浣风劍閹稿啿鐣烽幋锕€绠婚悹鍥у级瀹撳秴顪冮妶鍡樺鞍缂佸鍨剁粋宥夋倷椤掍礁寮垮┑鈽嗗灣閸樠勭妤e啯鍊垫慨妯煎亾鐎氾拷  闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閻愵剙鍔ょ紓宥咃躬瀵鏁愭径濠勵吅闂佹寧绻傞幉娑㈠箻缂佹ḿ鍘遍梺闈涚墕閹冲酣顢旈銏$厸閻忕偠顕ч埀顒佺箓閻g兘顢曢敃鈧敮闂佹寧妫佹慨銈夋儊鎼粹檧鏀介柣鎰▕閸ょ喎鈹戦鈧ḿ褔锝炲┑瀣╃憸搴綖閺囥垺鐓欓柟瑙勫姦閸ゆ瑧鐥幆褍鎮戠紒缁樼洴瀹曞崬螣閾忓湱鎳嗛梻浣告啞閿曨偆妲愰弴鐘愁潟闁规儳顕悷褰掓煕閵夋垵瀚ぐ顖炴⒒娴h鍋犻柛鏂跨焸閹儵宕楅梻瀵哥畾闂佸湱铏庨崰鏍矆閸愨斂浜滈柡鍐ㄥ€哥敮鍓佺磼閹邦厾娲存慨濠冩そ瀹曨偊宕熼崹顐嵮囨⒑閹肩偛濡肩紓宥咃工閻g兘濮€閻樺棙妞介、鏃堝川椤撴稑浜鹃柛顭戝亽濞堜粙鏌i幇顖氱毢濞寸姰鍨介弻娑㈠籍閳ь剛鍠婂澶娢﹂柛鏇ㄥ灡閺呮粓鎮归崶顏勭毢濞寸姵鎮傞幃妤冩喆閸曨剛鈹涚紓浣虹帛缁诲牓鎮伴鑺ュ劅闁靛⿵绠戝▓鐔兼⒑闂堟冻绱¢柛鎰╁妼椤╊剟姊婚崒姘偓鎼併偑閹绢喖纾婚柛鏇ㄥ€嬪ú顏呮櫇闁逞屽墰閸欏懘姊洪崫鍕犻柛鏂垮閺呭爼鏁撻悩鏂ユ嫽闂佺ǹ鏈悷锔剧矈閻楀牄浜滈柡鍥ф閹冲宕戦幘璇插瀭妞ゆ劑鍨虹拠鐐烘倵鐟欏嫭绀冪紒顔芥崌楠炲啴濮€閿涘嫰妾繝銏f硾椤戝洨绮欐笟鈧缁樻媴閻熸澘濮㈢紓浣虹帛閸旀洟鏁冮姀鈩冪秶闁宠桨绶″Λ婊堟⒑缁嬭法绠绘俊顐ユ硶閹广垽宕卞Ο闀愮盎闂佸搫绉查崝搴ㄣ€傞弻銉︾厵妞ゆ牗姘ㄦ晶娑㈡煏閸パ冾伃妞ゃ垺娲熸慨鈧柍鎯帮骏閸ㄦ椽濡甸崟顖f晜闁告洦鍋呭▓缁樼節绾版ǚ鍋撳畷鍥х厽閻庤娲栧畷顒冪亙闂侀€炲苯澧撮柨婵堝仦閹棃濡搁敂瑙勫闂備礁鎲$粙鎴︺偑閹绢喗鍊垮┑鍌氭啞閻撴洟鏌曟径瀣仴闁瑰啿楠搁锝夊Ω閵夈垺鏂€闂佺粯锕╅崰鏍倶鏉堛劎绠惧璺侯儑椤ジ鏌h閻倸顫忛搹鍦<婵☆垵宕甸崣鍡涙⒑閸涘﹨澹樻い鎴濐樀楠炲啴鏁撻悩鍙傘劑鏌嶉崫鍕偓鎼佸焵椤掑倹鏆柡灞诲妼閳规垿宕卞☉鎵佸亾濡ゅ懏鐓曟俊顖滅帛鐏忥箓鏌$仦鍓с€掗柍褜鍓ㄧ紞鍡涘磻閸涱垯鐒婇柟娈垮枤绾捐偐绱撴担璐細缂佺姵鎸婚妵鍕敃閿濆洨鐤勫銈冨灪閿氶柍钘夘槸閳诲氦绠涢敐鍕そ闂傚倸鍊峰ù鍥х暦閻㈢ǹ绐楅柟閭﹀枛閸ㄦ繈骞栧ǎ顒€鐏繛鍛У娣囧﹪濡堕崨顓熸闂佸搫妫欑划鎾诲蓟閻斿吋鍊绘俊顖濐嚙閺嗘顪冮妶鍌涙珕鐟滄澘鍟村﹢渚€姊虹紒妯诲碍婵炲鍏橀獮妤呮偐缂佹ḿ鍘介梺瑙勫劤閻°劎绮堢€n喗鐓涚€光偓閳ь剟宕伴弽顓犲祦闁糕剝鍑瑰銊╂⒑閹肩偛鈧宕伴弽顓炶摕鐎广儱顦扮€电姴顭块懜鐬垿鍩㈤崼銉︹拺闁告繂瀚€氭壆绱掓径濠傤暢婵″弶鍔欓獮鎺楀箠瀹曞洤鏋涢柟绛圭節婵″爼宕ㄩ鐔荤发濠电姷顣槐鏇㈠磻閹达箑纾归柕鍫濐槸绾惧鏌涘☉鍗炵仭鐎规洘鐓¢弻娑㈩敃閻樻彃濮庣紓浣哄Х婵數鎹㈠┑鍥╃瘈闁稿本绋戝▍锝夋⒑閸濆嫷鍎忛柣妤€锕ョ粚杈ㄧ節閸ヨ埖鏅┑鐘茬仛閸旀洖鈻撻鐑嗘富闁靛牆鎳愮粻鎵磽瀹ュ拑宸ユい顐㈢箲缁绘繂顫濋鍌︾床婵犵數鍋涘Λ娆撳春閸惊锝夘敋閳ь剙顫忛搹瑙勫厹闁告粈绀佸▓婵堢磽娴d粙鍝烘繛鍙夌矒瀹曟岸骞掗幋鏃€鐎婚梺瑙勫劤绾绢參顢樺ú顏呪拺闁圭ǹ瀛╅悡銉╂煙绾板崬浜濈紒鍌氱У缁轰粙宕ㄦ繛鐐闂備礁鎲$换鍌溾偓姘槻鍗辩憸鐗堝笚閻撴洟鏌曟繛褍鍟悘鍫ユ倵濞堝灝鏋熼柟顔煎€搁锝夘敋閳ь剙鐣锋總鍛婂亜闁告繂瀚粻浼存⒒閸屾瑧顦﹂柟璇х節瀹曟繆顦寸€垫澘锕幊鐐哄Ψ瑜滃ú鎼佹⒑閸涘﹥瀵欓柛娑卞灲缁卞啿鈹戦悙鑸靛涧缂傚秮鍋撳┑鐐叉嫅缁插潡寮灏栨婵ǹ浜敍婊堟煟鎼搭垳绉甸柛瀣噽娴滄悂骞嶉鍓э紲闂佺ǹ鏈粙鎴澝归鈧弻鈩冩媴缁嬫寧娈婚悗瑙勬礃鐢帡锝炲┑瀣疅閻庯綆鍓欑花銉︾節閻㈤潧校妞ゆ梹鐗犲畷鏉课旈崨顔芥珖闂佸啿鎼幊搴g矆閸儲鐓ラ柡鍥╁仜閳ь剙缍婂畷鎰版偨閸涘﹦鍘甸梺璇″灡濠㈡ǹ顣块梻浣瑰▕閺€杈╂暜閹烘绠掗梻浣瑰缁诲倿骞婅箛娑樼疅闁归棿鐒﹂悡銉︾箾閹寸偍缂氶懖鏍磽娴d粙鍝洪悽顖ょ節閵嗕礁顫濈捄鍝勭獩濡炪倖鎸炬慨鍐差浖閹剧繝绻嗛柕鍫濇搐鍟搁梺绋款儑閸嬨倕鐣疯ぐ鎺戝瀭妞ゆ梻鍋撳▓楣冩⒑閸撴彃浜濇繛璇х畵瀵偊宕卞☉娆戝幈闁诲繒鍋熼崑鎾绘儍閹达附鐓忛柛顐墰閻e灚鎱ㄦ繝鍛仩闁归濞€楠炴捇骞掗幋鐐垫И缂傚倸鍊搁崐鍝ョ矓閺夋嚦娑樷枎閹寸姷鐒块悗骞垮劚椤︻垶宕橀埀顒€顪冮妶鍡樺暗闁稿鍠栧畷顐⑽旀担铏诡啎闁诲海鏁告灙鐎涙繂顪冮妶鍡楃仴婵☆偅绻堥獮鍐灳閺傘儲鐎婚梺鐟板⒔鐞涖儵骞忛崫鍕垫富闁靛牆妫欑亸顏堟煕閺傚潡鍙勯柟顕€绠栧畷锟犳倻閸℃瑥鏁搁柣鐔哥矋缁挸鐣疯ぐ鎺撶劶鐎广儱鎲橀敃鍌涚厱闁哄洢鍔岄悘鐘充繆椤愶綇鑰块柡灞剧洴閳ワ箓骞嬪┑鍥╀簮闂備胶枪椤戝棝骞愭ィ鍐ㄧ疅闁圭虎鍠栫粈瀣亜閹惧鈯曢柡渚€娼ч埞鎴︽偐閸偅姣勬繝娈垮枟濞兼瑧鍙呴梺鎸庢礀閸婂摜澹曡ぐ鎺撯拺闁割煈鍣崕宥吤瑰⿰鍕煉闁绘搩鍋婂畷鍫曞Ω閿曗偓绾板秴顪冮妶鍛疄闁稿﹥绻堝璇测槈濮橈絽浜鹃柨婵嗛娴滄繄鈧娲栭惉濂稿焵椤掍緡鍟忛柛鐘崇墵閸┾偓妞ゆ帒鍊稿▍蹇斾繆娣囧崬濡奸柍瑙勫灴閹瑩骞撻幒鎾斥偓顖炴⒑缂佹﹩娈曟繛鑼枛瀹曟椽鎮欓崫鍕吅闂佹寧妫佸Λ鍕瑜版帗鐓熼幖绮瑰墲鐠愨€斥攽椤旇姤灏﹂挊鐔哥節闂堟侗鍎愰柍閿嬪灩缁辨帞鈧綆鍘奸崝鍨亜椤愵剛鐣甸柡灞剧洴瀵剟宕稿Δ鈧鏉课旈悩闈涗粶妞わ富鍨堕敐鐐哄閻樺灚娈曢梺閫炲苯澧撮柟顔兼健閸┾偓妞ゆ巻鍋撻柍瑙勫灴閹瑩寮堕幋鐘辨閻庡厜鍋撻柨婵嗘噺閸嬨儵鏌熼鍏煎仴鐎规洏鍔庨埀顒佺⊕鑿ら柟閿嬫そ濮婃椽妫冮埡浣烘В闂佸憡鐟㈤崑鎾斥攽閿涘嫬浜鹃柟顔煎€垮璇测槈閵忊€充汗闂佸綊顣﹂悞锕傛偪娓氣偓閹鈻撻崹顔界亶闂佺粯鎼换婵嬫偘椤曗偓瀵粙濡搁敃鈧鎾绘⒑闂堚晛鐦滈柛妯煎帶椤曪綁骞庨懞銉㈡嫽婵炶揪缍€濞咃絿鏁☉娆戠闁告瑥顦辨晶鐢碘偓瑙勬礃閸旀瑥鐣烽悜绛嬫晣婵炴垶眉婢规洖鈹戦缁撶細闁稿鎸鹃埀顒佺啲閹凤拷
核心提示:这个是我从Manual上copy下来的,希望对大家有用,usage of bcp command.(快来看)。,bcpDescription Copiesa database to or from an operating system file in a user-specified format.Syntax bc

这个是我从Manual上copy下来的,希望对大家有用。

bcp
Description 
 Copies a database to or from an operating system file in a user-specified format.
Syntax 
bcp [[database_name.]owner.][view_name | table_name  [:partition_id]] {in | out} datafile[-c] [-E] [-n] [-X]
 [-a display_charset]
 [-A size]
 [-b batchsize]
 [-e errfile]
 [-f formatfile]
 [-F firstrow]
 [-g id_start_value]
 [-I interfaces_file]
 [-J client_charset]
 [-L lastrow]
 [-m maxerrors]
 [-P password]
 [-q datafile_charset]
 [-r row_terminator]
 [-R remote_server_principal]
 [-S server]
 [-t field_terminator]
 [-T text_or_image_size]
 [-U username]
 [-z language]
or
bcp -v
Parameters 
database_name
is optional if the table being copied is in your default database or in master. Otherwise, you must specify a database name.
owner
is optional if you or the Database Owner owns the table being copied. If you do not specify an owner, bcp looks first for a table of that name that you own, and then looks for one owned by the Database Owner. If another user owns the table, you must specify the owner name or the command fails.
view_name
is the name of the view you are copying out.
table_name
is the name of the database table to copy.
Partition number partition_number does not exist in table table_name.
partition_id
is the identifier of the partition into which to copy.
in | out
is the direction of the copy. in indicates a copy from a file into the database table; out indicates a copy to a file from the database table or view.
datafile
is the full path name of an operating system file. The path name can be from 1 to 255 characters in length.
-c 
performs the copy operation with char datatype as the default. This parameter does not prompt for each field; it uses char as the default storage type, no prefixes, \t (tab) as the default field terminator, and \n (newline) as the default row terminator.
-E
explicitly specifies the value of a table's IDENTITY column.
By default, when you bulk copy data into a table with an IDENTITY column, bcp assigns each row a temporary IDENTITY column value of 0. As bcp inserts each row into the table, the server assigns the row a unique, sequential IDENTITY column value, beginning with the value 1. If you specify the -E flag when copying data into a table, bcp prompts you to enter an explicit IDENTITY column value for each row. If the number of inserted rows exceeds the maximum possible IDENTITY column value, Adaptive Server returns an error.
By default, when you bulk copy data from a table with an IDENTITY column, bcp excludes all information about the column from the output file. If you specify the -E flag, bcp copies the existing IDENTITY column values into the output file.
You cannot use the -E and -g flags together.
-n 
performs the copy operation using native (operating system) formats. Specifying the -n parameter means bcp will not prompt for each field. Files in native data format are not human-readable.
Warning! Do not use bcp in native format for data recovery or salvage or to resolve an emergency situation. Do not use bcp in native format to transport data between different hardware platforms, different operating systems, or different major releases of Adaptive Server. Do not use field terminators (-t) or row terminators (-r) with bcp in native format. Results are unpredictable and data could become corrupted. Using bcp in native format can create flat files that cannot be reloaded into Adaptive Server and it may be impossible to recover the data. If you are unable to re-run bcp in character format (for example, a table was truncated or dropped, hardware damage occurred, a database was dropped, and so on) the data will be unrecoverable.
-X
specifies that, in this connection to the server, the application initiates the login with client-side password encryption. bcp (the client) specifies to the server that password encryption is desired. The server sends back an encryption key, which bcp uses to encrypt your password, and the server uses the key to authenticate your password when it arrives.
-a display_charset
allows you to run bcp from a terminal where the character set differs from that of the machine on which bcp is running. Use -a in conjunction with -J to specify the character set translation file (.xlt file) required for the conversion. Use -a without -J only if the client character set is the same as the default character set.
The following error message will appear if the character translation file(s) named with the -a parameter is missing, or you mistype the name(s): 
Error in attempting to determine the size of a pair of translation tables.:'stat' utility failed.
-A size
specifies the network packet size to use for this bcp session. For example: 
bcp pubs2..titles out table_out -A 2048
sets the packet size to 2048 bytes for this bcp session. size must be between the values of the default network packet size and maximum network packet size configuration variables, and it must be a multiple of 512.
Use larger-than-default network packet sizes to improve the performance of large bulk-copy operations.
-b batchsize
is the number of rows per batch of data copied (the default is to copy all the rows in one batch). Batching applies only when you are bulk copying in; it has no effect on bulk copying out.
-e errfile
is the full path name of an error file where bcp stores any rows that it was unable to transfer from the file to the database. Error messages from the bcp program appear on your terminal. bcp creates an error file only when you specify this parameter.
-f formatfile
is the full path name of a file with stored responses from a previous use of bcp on the same table. After you answer bcp's format questions, it prompts you to save your answers in a format file. Creation of the format file is optional. The default file name is bcp.fmt. The bcp program can refer to a format file when you are copying data so that you do not have to duplicate your previous format responses interactively. Use the -f parameter only if you previously created a format file that you want to use now for a copy in or copy out. If you do not specify this parameter, bcp queries you for format information interactively.
-F firstrow
is the number of the first row to copy from an input file (default is the first row).
-g id_start_value
specifies the value of the IDENTITY column to use as a starting point for copying data in.
You cannot use the -g and -E flags together.
-I interfaces_file
specifies the name and location of the interfaces file to search when connecting to Adaptive Server. If you do not specify -I, bcp looks for an interfaces file (sql.ini on Windows platforms) located in the ini directory, which is below the directory specified by the SYBASE environment variable.
-J client_charset
specifies the character set to use on the client. bcp uses a filter to convert input between client_charset and the Adaptive Server character set.
-J client_charset requests that Adaptive Server convert to and from client_charset, the character set used on the client.
-J with no argument disables character set conversion. Use this if the client and server use the same character set.
Omitting -J sets the character set to a default for the platform, which may not necessarily be the character set that the client is using. See the System Administration Guide for more information about character sets and associated flags.
The following error message will appear if an incorrect or unrecognized character set is named with the -J parameter: 
Unrecognized localization object. Using default value 'iso_1'.
Starting copy...
 => warning.
-L lastrow
is the number of the last row to copy from an input file (default is the last row).
-m maxerrors
is the maximum number of errors permitted before bcp aborts the copy. bcp discards each row that it cannot build, counting each rejected row as one error. If you do not include this parameter, bcp uses a default value of 10.
-P password
specifies an Adaptive Server password. If you do not specify -P password, bcp prompts for a password. You can leave out the -P flag If your password is NULL.
-q datafile_charset
runs bcp to copy character data to or from a file system that uses a character set different from the client character set.
In Japanese language environments, the -q flag translates Hankaku Katakana (half-width characters) into Zenkaku Katakana (full-width characters).
The following error message will appear if the character translation file(s) named with the -q parameter is missing, or you mistype the name(s):
Error in attempting to determine the size of a pair of translation tables.:'stat' utility failed.
The ascii_7 character set is compatible with all character sets. If either the Adaptive Server character set or the client's character set is set to ascii_7, any 7-bit ASCII character is allowed to pass between client and server unaltered. Other characters produce conversion errors. Character set conversion issues are covered more thoroughly in the System Administration Guide.
-r row_terminator
specifies the row terminator.
Warning! Do not use -t or -r parameters with bcp in native format. Results are unpredictable and data could become corrupted.
 When specifying terminators from the command line with the -t or -r parameter, you must escape characters that have special significance to the Windows NT Command Prompt shell (see the following examples). Either place a backslash in front of the special character or enclose it in quotes. This is not necessary when bcp prompts you (interactive mode).
-R remote_server_principal
specifies the principal name for the server as defined to the security mechanism. By default, a server's principal name matches the server's network name (which is specified with the -S parameter or the DSQUERY environment variable). Use the -R parameter when the server's principal name and network name are not the same.
-S server
specifies the name of the Adaptive Server to which to connect. If you specify -S with no argument, bcp uses the server specified by the DSQUERY environment variable.
-t field_terminator
specifies the default field terminator.
Warning! Do not use -t or -r parameters with bcp in native format. Results are unpredictable and data could become corrupted.
-T text_or_image_size
allows you to specify, in bytes, the maximum length of text or image data that Adaptive Server sends. The default is 32K. If a text or an image field is larger than the value of -T or the default, bcp does not send the overflow.
-U username
specifies an Adaptive Server login name. If you do not specify username, bcp uses the current user's operating system login name.
-z language
is the official name of an alternate language the server uses to display bcp prompts and messages. Without the -z flag, bcp uses the server's default language. You can add languages to an Adaptive Server during installation or afterward, using the langinst utility or the sp_addlanguage stored procedure.
The following error message will appear if an incorrect or unrecognized language is named with the -z parameter: 
Unrecognized localization object. Using default value 'us_english'.
Starting copy...
 => warning.
-v 
reports the current version and copyright message of the bcp program.
Examples 
Example 1 
bcp pubs2..publishers out pub_out -c -t , -r \r
Copies data out of the publishers table in character format (using char for all fields) using the -c parameter. The -t field_terminator parameter ends each field with a comma, and the -r row_terminator parameter ends each line with a Return. bcp prompts only for a password.
Example 2 
bcp pubs2..publishers out pub_out
Password:
Enter the file storage type of field pub_id [char]:
Enter prefix length of field pub_id [0]:
Enter length of field pub_id [4]:
Enter field terminator [none]:
Enter the file storage type of field pub_name [char]:
Enter prefix length of field pub_name [1]:
Enter length of field pub_name [40]:
Enter field terminator [none]:
Enter the file storage type of field city [char]:
Enter prefix length of field city [1]:
Enter length of field city [20]:
Enter field terminator [none]:
Enter the file storage type of field state [char]:
Enter prefix length of field state [1]:
Enter length of field state [2]:
Enter field terminator [none]:
Copies data from the publishers table to a file named pub_out for later reloading into Adaptive Server. Press Return to accept the defaults specified by the prompts. The same prompts appear when you copy data into the publishers table.
Example 3 
bcp pubs2..publishers out pub_out -c -t , -r \r
Copies data out of the publishers table in character format (using char for all fields). The -t field_terminator parameter ends each field with a comma, and the -r row_terminator parameter ends each line with a Return. bcp prompts only for a password.
Example 4 
bcp pubs2..publishers out pub_out
Password:
Enter the file storage type of field pub_id [char]:
Enter prefix length of field pub_id [0]:
Enter length of field pub_id [4]:
Enter field terminator [none]:
Enter the file storage type of field pub_name [char]:
Enter prefix length of field pub_name [1]:
Enter length of field pub_name [40]:
Enter field terminator [none]:
Enter the file storage type of field city [char]:
Enter prefix length of field city [1]:
Enter length of field city [20]:
Enter field terminator [none]:
Enter the file storage type of field state [char]:
Enter prefix length of field state [1]:
Enter length of field state [2]:
Enter field terminator [none]:
Copies data from the publishers table to a file named pub_out for later reloading into Adaptive Server. Press Return to accept the defaults specified by the prompts. The same prompts appear when you copy data into the publishers table.
Usage 
稴ee Chapter 2, "Using bcp to Transfer Data to and from Adaptive Server" for an in-depth discussion of bcp.
稴ee the Performance and Tuning Guide for more information on how changing certain parameters can affect bcp for large batches.
穊cp provides a convenient, high-speed method for transferring data between a database table or view and an operating system file. bcp can read or write files in a wide variety of formats. When copying in from a file, bcp inserts data into an existing database table; when copying out to a file, bcp overwrites any previous contents of the file.
穀ou cannot copy into a view from an operating system file.
稶pon completion, bcp informs you of the number of rows of data successfully copied, the total time the copy took, the average amount of time, in milliseconds, that it took to copy one row and the number of rows copied per second.
稵he current version of bcp ignores the -y sybase_directory parameter.
穀ou cannot use named pipes to copy files in or out.
稥rror message format is different than previous versions of bcp. If you have scripts that perform routines based on the values of these messages you may need to re-write them, for example:
The display message that indicates the number of rows transferred has been changed. During a session, this version of bcp periodically reports a running total of rows transferred. This message replaces the "1000 rows transferred" message displayed by the previous bcp.
稤o not use -t or -r parameters with bcp in native format. Results are unpredictable and data could become corrupted.
Copying Tables with Indexes or Triggers
稵he bcp program is optimized to load data into tables that do not have indexes or triggers associated with them. It loads data into tables without indexes or triggers at the fastest possible speed, with a minimum of logging. Page allocations are logged, but the insertion of rows is not.
When you copy data into a table that has one or more indexes or triggers, a slower version of bcp is automatically used, which logs row inserts. This includes indexes implicitly created using the unique integrity constraint of a create table statement. However, bcp does not enforce the other integrity constraints defined for a table.
Because the fast version of bcp inserts data without logging it, the System Administrator or Database Owner must first set the system procedure sp_dboption, "DB", to true. If the option is not set to true, and you try to copy data into a table that has no indexes or triggers, Adaptive Server generates an error message. You do not need to set this option to copy data out to a file or to copy data into a table that contains indexes or triggers.
Because bcp logs inserts into a table that has indexes or triggers when you use slow bcp, the log can grow very large. You can truncate the log with dump transaction after the bulk copy completes and after you have backed up your database with dump database.
稺hile the select into/bulkcopy/pllsort option is on, you cannot dump the transaction log. Issuing dump transaction produces an error message instructing you to use dump database instead.
Warning! Be certain that you dump your database before you turn off the select into/bulkcopy/pllsort flag. If you have inserted unlogged data into your database, and you then perform a dump transaction before performing a dump database, you will not be able to recover your data.
稦ast bcp runs more slowly while a dump database is taking place.
稵able 4-2 shows which version bcp uses when copying in, the necessary settings for the select into/bulkcopy/pllsort option, and whether the transaction log is kept and can be dumped.
?
Table  4-2: Comparing fast and slow bcp
稡y default, the select into/bulkcopy/pllsort option is off in newly created databases. To change the default situation, turn this option on in the model database.
The performance penalty for copying data into a table that has indexes or triggers in place can be severe. If you are copying in a very large number of rows, it may be faster to drop all the indexes and triggers beforehand with drop index (or alter table, for indexes created as a unique constraint) and drop trigger; set the database option; copy the data into the table; re-create the indexes and triggers; and then dump the database. Remember to allocate disk space for the construction of indexes and triggers?about 2.2 times the amount of space needed for the data.
Responding to bcp Prompts 
When you copy data in or out using the -n (native format) or -c (character format) parameters, bcp prompts you only for your password, unless you supplied it with the -P parameter. If you do not supply either the -n, -c or -f formatfile parameter, bcp prompts you for information for each field in the table or view. 
稥ach prompt displays a default value, in brackets, which you can accept by pressing Return. The prompts include:
稵he file storage type, which can be character or any valid Adaptive Server datatype
稵he prefix length, which is an integer indicating the length in bytes of the following data
稵he storage length of the data in the file for non-NULL fields
稵he field terminator, which can be any character string
稴cale and precision for numeric and decimal data types
The row terminator is the field terminator of the last field in the table, view, or file.
稵he bracketed defaults represent reasonable values for the datatypes of the field in question. For the most efficient use of space when copying out to a file: 
稶se the default prompts
稢opy all data in the datatypes defined by their table
稶se prefixes as indicated
稤o not use terminators
稟ccept the default lengths
Table 4-3 shows the bcp prompts, defaults, and the possible alternate user responses:
Table  4-3: bcp prompts?their defaults and user responses
穊cp can copy data out to a file either as its native (database) datatype or as any datatype for which implicit conversion is supported for the datatype in question. bcp copies user-defined datatypes as their base datatype or as any datatype for which implicit conversion is supported. For more information on datatype conversions, see dbconvert in the Open Client DB-Library/C Reference Manual or the Adaptive Server Reference Manual.
Be careful when you copy data from different operating systems because not all operating systems use the same native datatypes (for example, copying from NT into a UNIX server).
稟 prefix length is a 1-, 2-, or 4-byte integer that represents the length of each data value. It immediately precedes the data value in the host file.
稦ields defined in the database as char, nchar, and binary are always padded with spaces (null bytes for binary) to the full length defined in the database. timestamp data is treated as binary(usage of bcp command.(快来看)。.
If data in the varchar and varbinary fields is longer than the length specified for copy out, bcp silently truncates the data in the file at the specified length.
稟 field terminator string can be up to 30 characters long. The most common terminators are a tab (entered as "\t" and used for all columns except the last one), and a newline (entered as "\n" and used for the last field in a row). Other terminators are: "\0" (the null terminator), "\" (backslash), and "\r" (Return). When choosing a terminator, be sure that its pattern does not appear in any of your character data.
For example, if you used tab terminators with a string that contained a tab, bcp would not be able to identify which tab represents the end of the string. bcp always looks for the first possible terminator, so, in this example it would find the wrong one.
When a terminator or prefix is present, it affects the length of data transferred. If the length of an entry being copied out to a file is less than the storage length, it is immediately followed by the terminator or the prefix for the next field. The entry is not padded to the full storage length (char, nchar, and binary data is returned from Adaptive Server already padded to the full length).
When bcp is copying in from a file, data is transferred until either the number of bytes indicated in the "Length" prompt has been copied or the terminator is encountered. Once the number of bytes equal to the specified length has been transferred, the rest of the data is flushed until the terminator is encountered. When no terminator is used, the table storage length is strictly observed.
稵able 4-4 and Table 4-5 show the interaction of prefix lengths, terminators, and field length on the information in the file. "P" indicates the prefix in the stored table; "T" indicates the terminator; and dashes, (--) show appended spaces. An ellipsis (...) indicates that the pattern repeats for each field. The field length is 8 bytes for each column; "string" represents the 6-character field each time.
?
Table  4-4: Adaptive Server char data
?
Table  4-5: Other datatypes converted to char storage
稵he file storage type and length of a column do not have to be the same as the type and length of the column in the database table. [If the types and formats copied in are incompatible with the structure of the database table, the copy fails.
稦ile storage length generally indicates the maximum amount of data that can be transferred for the column, excluding terminators and/or prefixes.
稺hen copying data into a table, bcp observes any defaults defined for columns and user-defined datatypes. However, bcp ignores rules in order to load data at the fastest possible speed.
穊cp considers any data column that can contain a null value to be variable length, so use either a length prefix or a terminator to denote the length of each row of data.
稤ata written to a host file in its native format preserves all of its precision. datetime and float values preserve all of their precision, even when they are converted to character format. Adaptive Server stores money values to a precision of one ten-thousandth of a monetary unit. However, when money values are converted to character format, their character format values are recorded only to the nearest two places.
稡efore copying data that is in character format from a file into a database table, check the datatype entry rules in the Adaptive Server Reference Manual. Character data that is being copied into the database with bcp must conform to those rules. Note especially that dates in the undelimited format (yy)yymmdd may result in overflow errors if the year is not specified first.
稺hen you send host data files to sites that use terminals different from your own, inform them of the datafile_charset that you used to create the files.

Tags:usage of bcp

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
更多精彩
    赞助商链接

    热点阅读
      焦点图片
        最新推荐
          精彩阅读