Re: SqlTypes Decimal



Hi Carlos,

According to the specs for Sql Server 2005, max precision is 38 for the decimal data type, by default, and the default precision is
18. You can examine the global @@MAX_PRECISION variable to retrieve the current maximum value for your database.

If you need to discover the precision for a specific column at runtime, you can execute a query that examines
INFORMATION_SCHEMA.COLUMNS:

USE TheDatabase;
GO

SELECT
NUMERIC_PRECISION,
NUMERIC_SCALE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'aspnet_WebEvent_Events' AND COLUMN_NAME = N'EventSequence';

--
Dave Sexton

<carlospedr@xxxxxxxxx> wrote in message news:1155904370.999798.24820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm using .Net Framework 2.0.

I Querying an Sql 2000 Database to fill a Dataset, the user dynamically
choses what tables to query to fill the dataset. I need to provide
information to the user about the tables, information such as the type
and size of the columns.

Though at start this seemed to be quite simple to do, I have now came
to a problem when working with decimal columns. how can I get the
number of digits that a decimal column suports?
I have tried using sqlTypes when filling the table but not have been
able to get this info.

Can SomeBody Help me Please.

Carlos Pedro



.



Relevant Pages

  • Re: ado.net and sql 2005
    ... Our framework generates a set of business objects and maps them through a ... .Net 1.1 decimal type and a sql server table column of money. ... about exceeding the precision but I was under the assumption for a money ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Multiplying numeric(19,4) Values
    ... , valuedata numericnot null ... The reason for this is how SQL Server handles precision for numeric ... The ultimate goal is not to lose any precision. ... and the first has 5 digits before the decimal place and the ...
    (microsoft.public.sqlserver.programming)
  • Re: use of tempdb by union all
    ... I trust that both you and Andrew recognize that precision in ... there are special situation where space inside the user database are ... > least one special situation where SQL Server will use space inside the ... >> Chief Tenaya ...
    (microsoft.public.sqlserver.programming)
  • Re: Saving a number with high preciosion in a ADO.NET table
    ... if it sufficient to only specify the decimal or I must add the precision as ... Sql Server is float, not decimal. ... that you specify. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: float storage and usage
    ... offers the maximum scale and precision.. ... I'm targeting sql server 2005 systems. ... float offers with widest ranges. ...
    (comp.databases.ms-sqlserver)