Viewing 15 posts - 7,306 through 7,320 (of 8,416 total)
dr_csharp (8/9/2009)
you use with instead while loop,why?
I use a common table expression (the WITH clause) to dynamically generate a table with the 24 values required. That allows the query...
August 9, 2009 at 10:09 pm
Jeff Moden (8/9/2009)
Do you know of anything that you can use in SELECT/INTO that will create a float column that isn't specifically cast as a float?
Et voila:
SELECT A =...
August 9, 2009 at 6:38 pm
Jeff Moden (8/9/2009)
Agreed but it will all be float in this case because of the 100.0.
Will it? 😉
100.0 comes out as NUMERIC(4,1) for me.
ABS(6) comes out as INT.
100.0 /...
August 9, 2009 at 6:26 pm
Jeff Moden (8/9/2009)
Paul White (8/9/2009)
(@Beverley: Jeff is kidding)Heh... not quite. 😉
I stand corrected! :w00t:
August 9, 2009 at 6:20 pm
Jeff Moden (8/9/2009)
Beverley (8/9/2009)
Thanks so much for the replies, guys! I'm on holidays for a week but will try these out when I get back!
Perfect! Hey guys... I've...
August 9, 2009 at 5:23 pm
Fair point.
Leaving aside the impact on the economy of a failed bank (though that has been demonstrated to be manageable in recent times ;-)) having a plane land on your...
August 9, 2009 at 5:21 pm
Jeff Moden (8/9/2009)
August 9, 2009 at 5:18 pm
Jeff Moden (8/9/2009)
You're a generous man. You must be bored today. 😉
:laugh:
Yes I surprised myself. I think it was the momentum from my first guess-answer that carried me!
I...
August 9, 2009 at 5:10 pm
Jeff Moden (8/9/2009)
No need for rounding if you're going to cast the answer...
Hey Jeff,
Valid point, but let me explain myself: I left the ROUND in for two reasons:
1. To...
August 9, 2009 at 5:08 pm
declare @value int;
set @value = 7;
select CONVERT(DECIMAL(9,3), ROUND((CONVERT(DECIMAL(38,10), 100)/ABS(@value)), 3));
-- OR
select CONVERT(DECIMAL(9,3), ROUND(100.0/ABS(@value)), 3));
The key is to watch the data types. I have guessed at @value being an INTEGER...
August 9, 2009 at 5:13 am
It would probably help a great deal if you could script out the procedure and the job from Management Studio and attach them to a post. Feel free to...
August 9, 2009 at 5:06 am
If a 747 were to crash into our data centre, I wonder how high up the list of concerns wondering if we had backups in the cloud would be...:laugh:
August 9, 2009 at 5:03 am
Try this then. I took the liberty of creating some example data.
USE tempdb;
SET NOCOUNT ON;
GO
IF OBJECT_ID(N'tempdb.dbo.Record', N'U') IS NOT NULL DROP TABLE dbo.Record;
IF OBJECT_ID(N'tempdb.dbo.#Temp', N'U') IS NOT...
August 9, 2009 at 4:38 am
dr_csharp (8/9/2009)
while @first < 23
begin
select Id,name,family
FROM record Where Time BETWEEN @first AND @second
set @first= @first + 1
set @second = @second + 1
end
Reading between the lines to see what it is...
August 9, 2009 at 3:20 am
On quick way to give us some hard data about the instances is to attach the output from the following command:
SELECT * FROM sys.configurations;
Paul
August 9, 2009 at 12:29 am
Viewing 15 posts - 7,306 through 7,320 (of 8,416 total)