September 11, 2013 at 2:52 am
Trying to copy one table to another in sql 2012, data type was set before me. Strangely, my end result have 10 times more money. I.e 27152555833.00 would appear as 271525558330.00 in end column?
The tables are identical, anybody have any idea why it would happen?
September 11, 2013 at 5:02 am
how did you copy the data ? (statement please)
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
September 11, 2013 at 7:25 am
I thought you'd never ask! #Lady from Glee 😛
INSERT INTO [IPTS_Staging].[dbo].[FactSectorKPIHist]
([Prospect]
,[OutstandingApplication]
,[Approved_AwaitingML]
,[ApprovedforKPIs]
,[HistDate])
SELECT
[Prospect]
,[OutstandingApplication]
,[Approved_AwaitingML]
,[ApprovedforKPIs]
,GETDATE()-1
FROM [IPTS_DW].[dbo].[FactSectorKPI]
And table:
CREATE TABLE [dbo].[FactSectorKPIHist](
[Prospect] [money] NULL,
[OutstandingApplication] [money] NULL,
[Approved_AwaitingML] [money] NULL,
[ApprovedforKPIs] [money] NULL,
[HistDate] [datetime] NULL
) ON [PRIMARY]
GO
September 11, 2013 at 7:45 am
hard to believe that's the query that multiplied your [money] numbers by 10 :crazy:
Does your source table also use the money data type for these columns ?
Can you repro the case ?
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
September 12, 2013 at 7:36 pm
ALZDBA (9/11/2013)
Can you repro the case ?
I'm interested in hearing the answer to this so I can use it on my bank account.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
September 12, 2013 at 7:37 pm
Dehqon D. (9/11/2013)
Trying to copy one table to another in sql 2012, data type was set before me. Strangely, my end result have 10 times more money. I.e 27152555833.00 would appear as 271525558330.00 in end column?The tables are identical, anybody have any idea why it would happen?
Could there be a trigger on the target table messing with your head?
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
September 12, 2013 at 10:59 pm
I thought finally found SQL Server bug 🙂 but no, it was another package that was messing with my end table. So, Dwain, it's safe to use Money type.
Thanks to all!
September 13, 2013 at 12:14 am
thank you for the feedback.
everybody at ease now :hehe:
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply