Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Прочее";
Текущий архив: 2008.05.04;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.006 c
15-1205931726
@!!ex
2008-03-19 16:02
2008.05.04
Аналог property в C++


15-1206006177
TUser
2008-03-20 12:42
2008.05.04
Чем больше бумаги, ...


15-1206408609
DimonS
2008-03-25 04:30
2008.05.04
Как заинсталлить драйвер Access?


2-1207594006
Nemeziz
2008-04-07 22:46
2008.05.04
Запрет на выбор IITEMS в ComboBox


2-1207681325
Ri2008
2008-04-08 23:02
2008.05.04
WM_POWERBROADCAST





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский