setting a sql bit field

I have an excel spreadsheet and I am importing it into sql.  One column is True or False,
How do I map it to a column that is of datatype bit?
Jeff_KingstonAsked:
Who is Participating?
 
PortletPaulConnect With a Mentor freelancerCommented:
1 = true
0 = false

change the column data in Excel perhaps? (i.e. to exclusively 1 or 0, no nulls, and not text 'True' 'False')
0
 
Aaron ShiloChief Database ArchitectCommented:
where is the problem just directly map the column .

do you get an error?
0
 
Jeff_KingstonAuthor Commented:
No, I just get null in all rows regardless of the true/false value in the imported field.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Aaron ShiloChief Database ArchitectCommented:
well i guess the fastest way for you is to load the excell into a STAGE table with column type Nvarchar and then move the data into your permanent table.
0
 
Harish VargheseProject LeaderCommented:
Hello Jeff,

Ideally, a column of boolean values TRUE/FALSE in Excel should be automatically mapped to bit field when you import into SQL Server table. I tried a sample file and it works fine for me. Would you mind attaching the file here, after removing any sensitive info?

-Harish
0
 
Jeff_KingstonAuthor Commented:
Worked like a dream.  Thanks
0
 
PortletPaulfreelancerCommented:
excellent. have fun.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.