Groups | Blog | Home
all groups > sql server (microsoft) > april 2007 >

sql server (microsoft) : SQL Data Types


Richnep
4/28/2007 11:28:17 AM
Hi All,

THis should be a simple one. I have a table where the primary key is a
vchar data type. The actual data is a 4 digit number between 1-9000.
Most are whole numbers (i.e. 2000) with no decimal places. There are a
few that have 1 decimal digit on them(i.e. 2000.1). What I would like
to do is change the data type to a numeric, but I also want it so that
the whole numbers with no decimal points do not have a ".0" on the end
of them. Is this possible? I tried switching to decimal data type and
it puts a .0 on the end of the whole numbers when I set the presicison
to 1 which is what it supposed to do.

The reason I am doing this is so that in forms the primary is numeric
sequential not vchar sequential.

I'm sure many of you DBA's can relate that although there is really no
sigifigance to having a .0 at the end of a whole number, it just sends
those seasoned mangers and users into convulsions :) Hence, the
question above.

Any help would be appreciated. Using SQL2000 Enterprise Edition SP4
Ed Murphy
4/28/2007 6:01:40 PM
[quoted text, click to view]

This should properly be done at the interface level, yes? I suppose you
AddThis Social Bookmark Button