Viewing 15 posts - 481 through 495 (of 1,825 total)
Charles.Otten (12/16/2010)
December 16, 2010 at 6:07 am
If i was you i would start by simplifying the logic in the loop and moving it piecemeal into the cursor statement.
ie....
(Untested)
Create function CalcField_2(@Field1 char(2),@TerminatingIOI char(<Something>),@ConnType int)
returns table
as
return
(
Select Case when...
December 16, 2010 at 5:19 am
My default answer would be it can be translated into a set based soultion , but it depends on what is happening when you say 'do the procesing and formatting...
December 16, 2010 at 4:15 am
Double post,
All replies to http://www.sqlservercentral.com/Forums/Topic1035686-391-1.aspx please
December 16, 2010 at 2:32 am
IIUC , you have a datetime datatype , and you wish to remove the time portion , correct ?
You cant , its intrinsic to the datatype, Please see this...
December 16, 2010 at 2:31 am
Alvin Ramard (12/15/2010)
Get rid of the CAST, and you still get the same results.This issue is that MONEY does not obey the same rules as DECIMAL(x, 4) or DECIMAL(x, 2).
I...
December 15, 2010 at 1:59 pm
LutzM (12/15/2010)
Lynn Pettis (12/15/2010)
Now I may be wrong,...
December 15, 2010 at 1:35 pm
There seem to bit a bit more going on in there :ermm:
But this should solve the 'simple' question you posed ...
select *,((counts*1.0) / sum(counts) over (partition by 1))*100.0
from @t
December 14, 2010 at 6:55 am
Can you show us how you have you attempted to solve this problem yourself ?
December 14, 2010 at 3:24 am
Craig Farrell (12/8/2010)
December 13, 2010 at 1:54 pm
Im not clear on your issue , but in any case i would start a new thread. Most people will ignore old threads.
December 13, 2010 at 7:46 am
Jeff Moden (12/12/2010)
Setup SQL Profiler and you'll have it.;-)
Dave Ballantyne (12/10/2010)
See the attached image for a screen shot from profiler
😉
December 12, 2010 at 11:43 pm
Unpivot the data , either manually using case or the UNPIVOT operator
and then its simply top(1) ordered by DateCol desc
December 10, 2010 at 8:34 am
As it is using an index spool , that does suggest that extra indexing is needed, since that is effectively what it is doing....
December 10, 2010 at 4:20 am
Something like this ? ...
with cteRand
as
(
Select top(1000) abs(checksum(newid())) as Rand
from sys.columns a cross join sys.columns b cross join sys.columns b
)
Select *
...
December 10, 2010 at 4:08 am
Viewing 15 posts - 481 through 495 (of 1,825 total)