Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2003
    Posts
    148

    Unanswered: Exporting BIT datatypes?

    Hi all. Im tryin to export (DTS) my some SQL server tables, many of which contain 'bit' datatypes. However, when DTS/SQL Serv. moves these bit datatypes out, it changes bit values to True/False values - which makes sense - however these are all going to plugin to web frontends where the SQL specifies condtions like: "if column1 = 0 then" etc..
    Is there anyway to get SQL server to export bit datatypes as just numeric values of 0/1?

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I tried it and I'm getting the same thing..

    You could do a view and dts that out

    SELECT CASE WHEN Col1 = 1 THEN '1' WHEN Col1 = 0 THEN '0' ELSE NULL END
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Sep 2003
    Posts
    8
    select cast(colBit as int) as colInt

  4. #4
    Join Date
    Dec 2003
    Posts
    148
    Quote Originally Posted by Brett Kaiser
    I tried it and I'm getting the same thing..

    You could do a view and dts that out

    SELECT CASE WHEN Col1 = 1 THEN '1' WHEN Col1 = 0 THEN '0' ELSE NULL END
    That is a darn good idea - but I dont have the privs. to make a view :-/
    Edit: this is all going straight into oracle.
    Last edited by RhythmAddict; 06-24-04 at 16:12.

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    So what format is the output in?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Dec 2003
    Posts
    148
    Quote Originally Posted by Brett Kaiser
    So what format is the output in?
    If I let DTS handle the datatype - it gives it the datatype NUMBER and the value 0 or -1.

    If I manually change the columns datatype to char, I get T or F.
    edit:this is all going directly into oracle.

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    You know you can just type the sql in to the source in DTS

    How much data are we talking about....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Dec 2003
    Posts
    148
    Quote Originally Posted by Brett Kaiser
    You know you can just type the sql in to the source in DTS

    How much data are we talking about....
    This happens in a few tables...We're talking over 10,000 rows.

  9. #9
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Does Oracle even have a bit datatype?

    What version we talking about?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  10. #10
    Join Date
    Dec 2003
    Posts
    148
    it most certainly does not. 9i.
    if i could use number, and it didn't automatically turn "1" into "-1" this wouldn't be a big deal but alas...

  11. #11
    Join Date
    Aug 2003
    Location
    Kingston, Ontario
    Posts
    106
    How about the ABS function? Would that work?

  12. #12
    Join Date
    Dec 2003
    Posts
    148
    Quote Originally Posted by grahamt
    How about the ABS function? Would that work?

    hmmm yes, that'd work on the front end for the conditonal statements but it'd still require me to change that all over the application unless there was some way to run that during DTS...(which there may be? I'm not too familiar with SQL server or DTS)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •