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.
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]
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?
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.
[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]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.