bang.prashant
Ten Centuries
Points: 1100
More actions
September 30, 2008 at 11:57 am
#198930
I have data in column1 having datatype -varchar (4)) with 2 values - Yes or No
I want to insert this data into other tables column2 having datatype -bit.
how to do that?
Gabriel P
SSCarpal Tunnel
Points: 4289
September 30, 2008 at 12:34 pm
#879070
bang.prashant (9/30/2008)I have data in column1 having datatype -varchar (4)) with 2 values - Yes or NoI want to insert this data into other tables column2 having datatype -bit.how to do that?
bang.prashant (9/30/2008)
insert into secondtable (column2)
select Cast(case when column1 = 'Yes' then 1 when column1 = 'No' then 0 end as bit)
from firsttable
September 30, 2008 at 12:49 pm
#879088
thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply