Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
prettyjenny
Yak Posting Veteran
57 Posts |
Posted - 2006-05-11 : 09:21:53
|
| Hello,I have a db that uses NUMERIC datatype for all ID fields (I converted from Access)...I am creating Store Procedures that uses Integer data type, should I convert to all Int data types for all ID fields on tables?What is a differences between Numeric and Int data types? (advantages....)Thanks.There is no stupid question.www.single123.com |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-11 : 09:38:35
|
| numeric and decimal are the same thing and take a precision (number of digits) and scale (number of decimal places).Integer is whole numbers only.They will have different mak values and integers tend to take less space.You can try an alter table alter column to change the datatype but I would due a table copy into another version of the table and rename then delete the old.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-05-11 : 09:40:16
|
| Numeric and Decimal datatypes can store decimal values, while the Integer datatypes can only store integers.So, if your data is continuous, you should use Decimal or Numeric. If it is discreet, you should convert the datatypes to Integer. |
 |
|
|
prettyjenny
Yak Posting Veteran
57 Posts |
Posted - 2006-05-11 : 09:50:39
|
| Should I use Integer because my ID fields are the whole numbers?Like Autonumber from Access , 1, 2, 3, 4, 5.....Thanks.There is no stupid question.www.single123.com |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-05-11 : 13:08:47
|
| In general, yes. |
 |
|
|
|
|
|
|
|