Em Andamento

Import CSV to SQL Server 2008

I have a csv file that has inconsistent quotes throughout. Whenever a certain column has a thousands seperator it surrounds the column with quotes, but when it has no comma it does not. The bulk import feature of SQL Server 2008 cannot handle this. I need a solution that takes the import of a csv file and loads it to my sql table correctly. I will include a script of the table and a sample CSV file.

I have tried the SQL command BULK IMPORT, but it cannot handle the inconsistent quotes.

I would be ok with a php page solution like this: [url removed, login to view]

CREATE TABLE [dbo].[StagingTransactions](

[RefID] [varchar](50) NOT NULL,

[CheckIn] [varchar](50) NULL,

[CheckOut] [varchar](50) NULL,

[NumberofNights] [varchar](50) NULL,

[PaymentDate] [varchar](50) NULL,

[PaymentType] [varchar](50) NULL,

[PropertyID] [varchar](50) NULL,

[GuestName] [varchar](50) NULL,

[PaymentMethod] [varchar](50) NULL,

[TaxableRevenue] [varchar](50) NULL,

[NonTaxableRevenue] [varchar](50) NULL,

[Tax] [varchar](50) NULL,

[PaidByGuest] [varchar](50) NULL,

[TransactionFee] [varchar](50) NULL,

[DepositAmount] [varchar](50) NULL,

[Currency] [varchar](50) NULL,

[ReservationID] [varchar](1100) NULL

This needs to be a solution that can be reused weekly.

Habilidades: PHP, Arquitetura de software

Ver mais: php script null, my sql create database, sql csv import vb6, magento sql csv import, sql csv import, sql server 2000 csv import, import csv file table sql server wizard, create table sql server schema csv file, import csv file table sql server 2005 express, sql server create table graphically cnet dbo, sql express import table

Acerca do Empregador:
( 49 comentários ) Walled Lake, United States

ID do Projeto: #10497984

Premiar a:

mauricemarinus

Hi there. I had a look at your csv file. Are you saying that the following bit of is interpreted incorrectly by your import? $140.86,$200.00,$15.83,$365.83,($9.14) If so I can probably write a small c# or delphi Mais

$25 USD em 1 dia
(7 Avaliações)
2.6

5 freelancers estão ofertando em média $30 para este trabalho

MoustafaS

Hello. I can do this within the next 2 hours. and you only pay for results. if you agree, let me know and I will start right away.

$35 USD em 1 dia
(17 Comentários)
4.6
OwaisAlyas786

SAAS Hello Sir, I am very good developer of Ms sql, I have more then 1 year experience of sql, I will done your project in very short time and in very less cost to the other, I hope you can trust me and awar Mais

$30 USD em 1 dia
(1 Comentário)
0.6
$30 USD em 1 dia
(1 Comentário)
0.8
petraH

A proposal has not yet been provided

$25 USD em 1 dia
(1 Comentário)
0.4
mraster

Hi, do you need one time solution? just to have corrected csv or you need a method?

$35 USD in 2 dias
(0 Comentários)
0.0