Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is numeric(12,7)?

Status
Not open for further replies.

feshangi

MIS
Nov 24, 2004
265
0
0
US
I’m trying to create fields according to my notes and the note is referring to numeric(12,7). Is this same as Int datatype or it means something different.

I appreciate on any comments.

Thanks,

Mike
 

in paradox or dbase this type is float or doublt
if you want to create an integer field you shoud set (dec) to 0 like this : numeric(12,0)
 
But be very careful how you use numeric(12,0). It is not the same as integer in all respects. Integer math and numeric (decimal) math have different rounding rules.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Thank you all.

I purchased a Global Cities database and the database is in text file. Database manual tells me about the fields and their datatypes. Some are varchar(5), some are int, and some are numeric(12,7). The varchar and int datatypes are straight forward but the numeric(12,7) is confusing me!

Do you guys have any idea in which datatype I should put numeric(12,7) in my SQL 2000 table?

Mike
 
Depends entirely on how the data will be used.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
The notes are telling you I imagine about the type of data fields that you need to create to hold the data in the supplied file.

Numeric (12,7) means that the 12 is the precision of the data i.e. it specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision. The maximum precision is 38. The 7 is the scale which specifies the maximum number of decimal digits that can be stored to the right of the decimal point. So your maximum data might look like 99999.9999999.

Is this longitute/latitude data - not sure - what is the field called.

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
you are correct.

the fields are for longitute/latitude
 
Numeric (8,5) would be sufficient.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Numeric (n,m) is a datatype. Read about it in BooksOnLine (BOL) which is probably installed on your workstation in the SQL folder.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top