Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.05.04;
Скачать: CL | DM;

Вниз

MS SQL Server 2000   Найти похожие ветки 

 
usr   (2008-03-20 14:22) [0]

Необходимо в таблице числовое значение некой площади, например 2321.32 (М^2).

Какой лутше всего использовать тип данных для поля, decimal, или numeric ?
В чем отличие ?


 
Ega23 ©   (2008-03-20 14:38) [1]


> В чем отличие ?


для  MS SQL Server 2000 - ни в чём.


 
Jeer ©   (2008-03-20 14:46) [2]

MS SQL 2000
In SQL Server, the numeric data type is equivalent to the decimal data type.
In Transact-SQL, numeric is functionally equivalent to the decimal data type.

Numeric and decimal now use 5, 9, 13, or 17 bytes of storage
The decimal data type can store a maximum of 38 digits (17 byte), all of which can be to the right of the decimal point.
The decimal data type stores an exact representation of the number; there is no approximation of the stored value.
Use the decimal data type to store numbers with decimals when the data values must be stored exactly as specified.

Approximate numeric (floating-point) data consists of data preserved as accurately as the binary numbering system can offer.
Approximate numeric data is stored using the float and real data types in SQL Server.

Converting from decimal or numeric to float or real can result in some loss of precision.
Converting from int, smallint, tinyint, float, real, money, or smallmoney to either decimal or numeric can result in overflow.
By default, SQL Server uses rounding when converting a number to a decimal or numeric value with a lower precision and scale.
However, if the SET ARITHABORT option is ON, SQL Server raises an error when overflow occurs.
Loss of only precision and scale is not sufficient to raise an error.


 
Игорь Шевченко ©   (2008-03-20 15:05) [3]


> Какой лутше всего использовать тип данных для поля


VARCHAR(2000)


 
DiamondShark ©   (2008-03-20 15:12) [4]


> decimal, или numeric ?

Это синонимы.


> лутше

В слове "лучше" нет буквы "т".


> Какой

Любой.
Есть ещё float и real.
Вооружаешься требованиями предметной области и своими знаниями отличий типов с фиксированной и плавающей точкой и выбираешь.


 
Ega23 ©   (2008-03-20 15:12) [5]


> Игорь Шевченко ©   (20.03.08 15:05) [3]


Почему именно 2000?
Это намёк на версию сервера?  :)


 
Игорь Шевченко ©   (2008-03-20 16:18) [6]

Ega23 ©   (20.03.08 15:12) [5]

Я не знаю, сколько максимум у SQL-сервера. У Oracle было 2000


 
Kolan ©   (2008-03-20 16:22) [7]

Float


 
Ega23 ©   (2008-03-20 16:39) [8]


> Я не знаю, сколько максимум у SQL-сервера.


для 2000 - maxvarchar(8000), maxnvarchar(4000)


 
Petr V. Abramov ©   (2008-03-20 16:42) [9]


> Игорь Шевченко ©   (20.03.08 16:18) [6]

вот именно что было, в семерке.



Страницы: 1 вся ветка

Текущий архив: 2008.05.04;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.008 c
15-1201816478
Eraser
2008-02-01 00:54
2008.05.04
Remote Office Manager - бета тестирование 2


15-1205930041
Elec3C
2008-03-19 15:34
2008.05.04
with в C++


15-1206456184
Andy BitOff
2008-03-25 17:43
2008.05.04
Бумеранг в космосе


2-1207738307
Елвис
2008-04-09 14:51
2008.05.04
TObjectList


2-1207470775
malyar
2008-04-06 12:32
2008.05.04
sql запросы без sql сервера