Forum Replies Created

Viewing 15 posts - 7,306 through 7,320 (of 8,416 total)

  • RE: mix results in one result

    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...

  • RE: Formatting issue with a calculated value

    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 =...

  • RE: Formatting issue with a calculated value

    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 /...

  • RE: How to divide results into two somewhat-equal piles?

    Jeff Moden (8/9/2009)


    Paul White (8/9/2009)


    (@Beverley: Jeff is kidding)

    Heh... not quite. 😉

    I stand corrected! :w00t:

  • RE: How to divide results into two somewhat-equal piles?

    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...

  • RE: Backup to the Clode - No Excuses

    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...

  • RE: checksums and unicode data

    Jeff Moden (8/9/2009)


    Even then, it can and will give an incorrect answer if you rely only on it. I'll admit that CHECKSUM will help narrow things down on long...

  • RE: mix results in one result

    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...

  • RE: Formatting issue with a calculated value

    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...

  • RE: Formatting issue with a calculated value

    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...

  • RE: SP won't execute when called from a job

    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...

  • RE: Backup to the Clode - No Excuses

    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:

  • RE: mix results in one result

    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...

  • RE: mix results in one result

    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...

  • RE: Speed Optimization

    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

Viewing 15 posts - 7,306 through 7,320 (of 8,416 total)