473,491 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Specifying Precision and Scale for SQLDecimal in User Defined CLR SQL Server Function

How in the hell does one specify the precision and scale for the
SQLDecimal type? I am writing a user defined CLR SQL Server function
and one of the function parameters is a decimal value which in SQL
Server would be type numeric(18,6), but the only type that seems to be
an equivalent on the VB 2005 side is SQLDecimal, but there seems no way
to set the precision and scale for this (outside of using a new
constructor, which is not allowed for a function parameter list). It
appears by default that the scale for the SQLDecimal type is 0, so when
I call the function with say 0.01, the value is truncated to 0, which
causes all to go to shit. Can anyone help? The VB documention blows
when it comes to the SQLTypes.

Thanks,

Mar 24 '06 #1
0 1871

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
5926
by: Ladvánszky Károly | last post by:
Entering 3.4 in Python yields 3.3999999999999999. I know it is due to the fact that 3.4 can not be precisely expressed by the powers of 2. Can the float handling rules of the underlying layers be...
36
6313
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
3
8621
by: James Foreman | last post by:
I'm using DB2 UDB 8.1.2 on Suse linux. Try this: CREATE TABLE testsums (cost_of_sale decimal(7,2), price decimal(9, 2)); INSERT INTO testsums VALUES (10000, 30000); SELECT cost_of_sale/price...
0
3554
by: Daniel Zelisko | last post by:
Hello Could anyone tell me how to send a null decimal value to the sql server depending on its value? The following code gives me an error: System.Data.SqlTypes.SqlNullValueException: Data is...
2
1410
by: Mark | last post by:
Hi all, I have a DAL which takes in a value as shown below ready for my MSSQL stored procedure. protected SqlDecimal _annualLeave = SqlDecimal.Null; public SqlDecimal AnnualLeave { get...
0
946
by: Crazy Cat | last post by:
How in the hell does one specify the precision and scale for the SQLDecimal type? I am writing a user defined CLR SQL Server function and one of the function parameters is a decimal value which in...
2
4286
by: Sam | last post by:
Hi, I would like to be able to read the scale & precision of a decimal type contained in a sql server table from vb.net. I would like to set some properties (like width,format) of a gridview's...
3
41607
by: Vamsi | last post by:
Hi, I have a column defined as decimal(4,3). I get the following error when I try to insert "12.50000000000000" CLI0111E Numeric value out of range. SQLSTATE=22003 sqlstate = 22003 I even...
3
13645
by: Boot2TheHead | last post by:
This one cost me a solid half hour yesterday. I'm wondering why on earth the default precision for a decimal type is 18,0. Maybe I'm mistaken. A decimal datatype sort of implies that you'd want...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.