最近一直在使用常用資料庫的資料匯入,這裡把已經用到的匯入命令先簡要列舉一下:
不介紹每乙個option的具體意義,如果你用到了,請直接msdn檢視具體option的意義,此處不再贅述!
bulk insert [erp].[users]
from
'd:\rows_1m.txt'
with (
datafiletype='widechar',
fieldterminator =',',
rowterminator = '\n'
);go
load data infile '/home/test/users_1m_rows.txt'
into
table dummy_users fields terminated by
',' lines terminated by
'\n' (col00,col01,col02,col03,col04,col05,col06,col07,col08,col09,col10,col11,col12,col13,col14,col15,col16,col17,col18,col19,col20,col21,col22,col23,col24,col25,col26,col27,col28,col29,col30,col31);
不贅述option的意義了。
\copy "users"("col00","col01","col02","col03","col04","col05","col06","col07","col08","col09","col10","col11","col12","col13","col14","col15","col16","col17","col18","col19","col20","col21","col22","col23","col24","col25","col26","col27","col28","col29","col30","col31") from '/home/test/pg_1m.txt' delimiter '|' encoding 'utf-8'
同樣也不介紹具體的option的意義,大部分都是self-explain的。
to be added
從文字檔案匯入資料到hive表中
從文字檔案匯入資料到hive表中 1.資料儲存為csv格式,不能帶標題行,以逗號分隔,用tr命令將逗號替換成hive預設的 001分隔 tr 001 home zengsiwei362 zhoulixin54520150730.csv home zengsiwei362 zhoulixin54520...
MSSQLSERVER資料庫 匯入文字檔案
有時候需要把文字檔案根據一定的格式批量匯入資料庫,mssqlserver提供了這樣的匯入語句 bulk insert ebss.mss actingwork ml from c 表資料 mss actingwork ml.txt with fieldterminator rowterminator ...
文字檔案資料匯入SQL Server資料庫
阿斯頓 12 周小川 14 東豐閣 15 using system using system.collections.generic using system.linq using system.text using system.windows using system.windows.contr...