Thursday, March 22, 2012

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?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|||select cast(colBit as int) as colInt|||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.|||So what format is the output in?|||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.|||You know you can just type the sql in to the source in DTS

How much data are we talking about...|||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.|||Does Oracle even have a bit datatype?

What version we talking about?|||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...|||How about the ABS function? Would that work?|||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)

No comments:

Post a Comment