Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CAST or not to CAST
Message
From
03/07/2001 05:08:05
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
CAST or not to CAST
Miscellaneous
Thread ID:
00526174
Message ID:
00526174
Views:
47
Hi Again,

I'm currently analysing stored procedures and come across the following (this is just an example):

DECLARE @calc1 AS decimal(12,2)
DECLARE @calc2 AS decimal(6,2)

SET @calc1 = 123343.42
SET @calc2 = 342.23

CREATE TABLE ta1 (updcol decimal(12,2))

UPDATE ta1 SET ta1.updcol = CAST(SUM(@calc1 * @calc2) AS decimal(12,2))

I've run some test on using CAST and not using it, and I can see no difference in the results.

Does anyone else know of an issue with me taking out the CAST, except maybe speeding the UPDATE up?

Cheers
Lee
Next
Reply
Map
View

Click here to load this message in the networking platform