Viewing 15 posts - 76 through 90 (of 101 total)
Click on my name to the left and there will be an option to send email...
December 10, 2008 at 6:10 pm
Can you post your stored proc and then I can show you the changes.
December 10, 2008 at 4:08 pm
When you run your stored proc do you get the full output of seven days? If so you could drop the table at the start of the sp and...
December 10, 2008 at 3:57 pm
So... as each day comes along you want to add a NEW column to the final destination table? i.e. after a year there would be 365 columns...
December 10, 2008 at 3:46 pm
hmmmmm. I did something a while back that may be similar to your requirements. I ended up using a dynamic sql string and a temp table inside a...
December 10, 2008 at 3:33 pm
Hi,
The column names shouldn't be a problem, so long as you put them in square brackets.
E.g.
create table #temp
(
[source] varchar ,
[type] int,
[10/11] int,
[09/11] int,
[08/11] int,
[07/11] int,
[06/11] int,
[05/11] int,
[getdate()] datetime
)
select * from...
December 10, 2008 at 3:10 pm
Hi ,
There are at least a couple of options you can use.
1. use a common table expression - http://msdn.microsoft.com/en-us/library/ms190766.aspx
Something a bit like this (untested)....
with cteAppt( [list all...
December 7, 2008 at 7:33 pm
Hi,
Well I'm not sure if this is the 'optimal' solution... But it does work! If you are running this across millions of rows it might be a bit...
December 2, 2008 at 3:08 pm
Heres an example of what you can do. Note that you DO need a common ID to join the two table...
Firstly some example tables. We have two tables...
November 24, 2008 at 3:46 pm
Hey glad to help! There isn't much activity on the forums when I am logged in so it is great to help out where I can. I think...
November 20, 2008 at 7:32 pm
Cast it as a string (after casting as decimal) and then you can add the strings together:
select cast(cast(@res1 as decimal(20,4)) as varchar(30)) + 'pt'
November 20, 2008 at 7:25 pm
I think that rounding is correct.
Try this for example:
declare @res1 as float, @res2 as float
select @res1 = 123.123456789
select @res2 = 123.123444444
select cast(@res1 as decimal(20,4))
select cast(@res2 as decimal(20,4))
November 20, 2008 at 7:21 pm
Hi,
I'm not sure what else you are doing with this data - but I don't think you need to loop through all your rows and put everything into a table...
November 20, 2008 at 3:57 pm
Hi,
Is this what you are after?
select cast(@res as decimal(20,4))
November 20, 2008 at 3:25 pm
I get the same execution plan for both queries and the exact same run-time. But I am running it on a measly 5 records. I'd be interested to...
November 19, 2008 at 4:15 pm
Viewing 15 posts - 76 through 90 (of 101 total)