General information
Forum:
Microsoft SQL Server
Title:
CAST or not to CAST
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only