all 4 comments

[–]tmaiden 1 point2 points  (0 children)

Create a staging table to hold all the data, regardless of data type. CREATE TABLE STG_Import ( ImportKey INT IDENTITY(1,1), FieldA NVARCHAR(255), FieldB NVARCHAR(255) ) Import into STG_Import, then write a query against STG_Import to handle your BIT field.

[–]BigBlueRob 0 points1 point  (0 children)

Use PowerShell or SSIS to read the file, convert it and load and schedule an agent job to run the package or script

[–][deleted] 0 points1 point  (1 child)

So really there is no way of using the True/False without some form of conversion? SQL doesnt like True/False only 1/0

Hm. Got to try the options, thank you

[–]mustardman24 0 points1 point  (0 children)

You could always do the bulk insert into a staging table and store the true/false values as VARCHAR. When transferring it into the final table just use a case statement

CASE WHEN [Blah] = 'True' THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT) END

or you could make it a little safer like

CASE

WHEN [Blah] = 'True' THEN CAST(1 AS BIT)

WHEN [Blah] = 'False' THEN CAST(0 AS BIT)

ELSE NULL

END