Sử dụng BCP Utility (Bulk Copy Program)
BCP là công cụ dòng lệnh của SQL Server để import/export dữ liệu hàng loạt giữa database và file text.
Export dữ liệu ra file text
BCP Db.TN out "Duong_dan_file_text" -c -S Ten_Server –T
Import dữ liệu từ file text vào SQL Server
BCP Db.TN in "Duong_dan_file_text" -c -S Ten_Server –T
-c: Ký tự (character) format.-S: Tên server.–T: Trusted connection (Windows Authentication).
Tùy chọn khác: Edit Mappings khi import từ Flat File
Trong SQL Server Import/Export Wizard, có thể chỉnh sửa mapping cột để xử lý tên cột chứa ký tự đặc biệt như '/'.
