Thanks to Michael Mcinnis, Martin Higham, Peter Horsb�ll M�ller and Lars
Nielsen for good replies :-)

My problem was that MI couldn't get thet column type right automatically
when linking a DBMS table with a Float column. The consequence of this was
that numbers equal to and larger than 2.147.483.647 (2^31 as Lars and Martin
wrote) were linked as negative values because MI by default assigned an
integer type to the column. (See below)

Michael McInnis suggested to write a stored procedure in SQL Server with
CAST functions to get the column types right. He also send me a good
example, thanks.
This approach will fundamentally give a better performance compared to do
the casts in the SQL Expert because a server refresh would have to redo the
casts from scratch, so to speak (Correct me if I'm wrong ;-) )

Peter pointed out that MI _should_ understand a SQL_DECIMAL type as in my
case, but this is obviously not correct at least on my machine :-( And
Peter's suggestion to alter the type in the SQL Server table is not an
issue. My data are updated from the 'outside' without my interference...

Well, based on the replies, I can only consider this problem as being a BUG
in MI. It _does not_ get the default type right which creates obvious
errors.
My workaround is to use first the column filter to get the right column
names and then the SQL Expert to do the CAST. I'm not so keen on creating a
stored procedure -> my skills in the dba business are mostly based on
try-and-error ;-)

Regards
S�ren Breddam

-----Oprindelig meddelelse-----
Fra: S�ren Breddam [mailto:[EMAIL PROTECTED]
Sendt: 25. februar 2004 23:31
Til: MapInfo-L (E-mail)
Emne: MI-L Wrong default types in linked DBMS table


Hi,

I've come across a very odd problem with linked tables from a SQL Server. It
seems as if MI (7.0) can't import the bigger numbers or assign the right
column type when i try to link a table with 10 digit numbers in a column.
The table is by default linked with the column type Integer and therefore
larger numbers than 2.147.483.647 are imported totally wrong. Those values
are converted from e.g 2.612.390.773 to -1.682.576.523 (sic!)
When I used the SQL Expert to import the table and used the SQL function
CAST(MyColName As Float) (or char...) everything was fine but it was a
nuisance to write all the cols in the SQL Expert.
Can anyone shed some light over this and tell me why MI can't assign a float
type to the column by default?

TIA
Regards

S�ren Breddam
GIS- og IT-koordinator
Teknik og Erhvervsforvaltningen
Stevns Kommune - www.stevns.dk 
        *       Tlf.:   5656 1800
        *       Dir.:   5656 1891



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10600

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10623

Reply via email to