Questions tagged «bulk»

11
将CSV文件导入SQL Server
我正在寻找使用导入.csv文件到SQL Server的帮助BULK INSERT,我有几个基本问​​题。 问题: CSV文件数据,之间(例如:描述)之间可能有(逗号),那么如何进行导入处理这些数据? 如果客户端从Excel创建CSV,则用逗号括起来的数据""(用双引号引起来)(如下例所示),那么导入如何处理呢? 我们如何跟踪某些行是否包含不良数据,哪些导入会跳过?(导入会跳过不可导入的行) 这是带标题的示例CSV: Name,Class,Subject,ExamDate,Mark,Description Prabhat,4,Math,2/10/2013,25,Test data for prabhat. Murari,5,Science,2/11/2013,24,"Test data for his's test, where we can test 2nd ROW, Test." sanjay,4,Science,,25,Test Only. 和SQL语句导入: BULK INSERT SchoolsTemp FROM 'C:\CSVData\Schools.csv' WITH ( FIRSTROW = 2, FIELDTERMINATOR = ',', --CSV field delimiter ROWTERMINATOR = '\n', --Use to shift …
185 sql  sql-server  csv  bulkinsert  bulk 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.