Andrew
Andrew

Reputation: 11

SQL Server BULK Insert with non standard NULL value

I have a large CSV file with columns that support NULL but the value for NULL is "NA". How can I import this to SQL server without replacing those values with NULL?

Upvotes: 1

Views: 522

Answers (2)

StuartLC
StuartLC

Reputation: 107357

If the field is a *char then why not import the value as NA, and then run a bulk update setting the field to NULL after import?

Upvotes: 2

gbn
gbn

Reputation: 432601

Import it as the string NA. It isn't NULL. Nothing to worry about.

Upvotes: 2

Related Questions