Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

How to insert CSV data into DB where some data don't have double quotes

$
0
0
Example of data in CSV are as follows:[code="sql"]"XXX","0001",-990039739 ,0 ,0 ,0 ,0 ,0 ,0"ABC"," ",-3422054702 ,0 ,481385 ,0 ,0 ,0 ,0"JJZ","0001",0 ,0 ,0 ,0 ,0 ,0 ,0[/code]Here's my format:[code="plain"]12.0101 SQLCHAR 0 0 "\"" 0 "" ""2 SQLCHAR 0 5 "\",\"" 1 OKCCY SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 6 "\",\"" 2 OKBRNM SQL_Latin1_General_CP1_CI_AS4 SQLMONEY 0 19 "\",\"" 3 OKONPX SQL_Latin1_General_CP1_CI_AS5 SQLMONEY 0 19 "\",\"" 4 OKONPM SQL_Latin1_General_CP1_CI_AS6 SQLMONEY 0 21 "\",\"" 5 OKFRX SQL_Latin1_General_CP1_CI_AS7 SQLMONEY 0 21 "\",\"" 6 OKFPX SQL_Latin1_General_CP1_CI_AS8 SQLMONEY 0 19 "\",\"" 7 OKMRX SQL_Latin1_General_CP1_CI_AS9 SQLMONEY 0 19 "\",\"" 8 OKMPX SQL_Latin1_General_CP1_CI_AS10 SQLMONEY 0 5 "\"\r" 9 OKSEQ SQL_Latin1_General_CP1_CI_AS[/code]

Viewing all articles
Browse latest Browse all 3145

Trending Articles