Главная страница
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.019 c
15-1206025363
ms1
2008-03-20 18:02
2008.05.04
SQL Serveur 2000


2-1207383847
andreil
2008-04-05 12:24
2008.05.04
Преобразовать массив пикселей в BitMap?


15-1206100907
Bober_crazy
2008-03-21 15:01
2008.05.04
Простейший вопрос по PHP


6-1185723678
Debug
2007-07-29 19:41
2008.05.04
Разрыв соединения с многопоточным сервером


15-1206101436
vajo
2008-03-21 15:10
2008.05.04
как удалить Висту с компьютера?