Forum Replies Created

Viewing 15 posts - 6,901 through 6,915 (of 8,760 total)

  • RE: Seems like a simple problem. Need to decrease an Amt by a fixed maximum spread over several rows.

    An alternative solution, not as efficient as QU but should be easier to understand

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    declare @tbl table

    (LineNum int,

    Code varchar(2),

    Amt money,

    MaxAmt money

    )

    insert into @tbl (LineNum, Code, Amt, MaxAmt)

    values

    (1,'AA',10.00,50.00),

    (2,'AA',20.00,50.00),

    (3,'AA',10.00,50.00),

    (4,'AA',40.00,50.00),

    (5,'AA',10.00,50.00);

    SELECT

    ...

  • RE: raiserror level

    Thank you for the question Steve.

    Slightly off topic, prefer using RAISERROR to PRINT for progress reporting on long running scripts as it is almost instant and the printf functionality is...

  • RE: Are the posted questions getting worse?

    Ed Wagner (10/1/2014)


    Eirikur Eiriksson (10/1/2014)


    Evil Kraig F (10/1/2014)


    ... Anything else I've missed in the last week and a half or so?

    Nothing much, QoDs been controversial, SQL Server will become...

  • RE: Are the posted questions getting worse?

    Evil Kraig F (10/1/2014)


    ... Anything else I've missed in the last week and a half or so?

    Nothing much, QoDs been controversial, SQL Server will become Hadoop only, aliens are...

  • RE: Is their a way to get metadata info about views

    Quick thought, on 2012 this will work

    😎

    SELECT * FROM sys.all_sql_modules WHERE object_id = OBJECT_ID('dbo.MYVIEW')

    SELECT * from sys.dm_exec_describe_first_result_set(N'select * from dbo.MYVIEW',NULL,NULL) as x

  • RE: Are the posted questions getting worse?

    SQLRNNR (10/1/2014)


    FTR - Jack was renewed today as well.

    If I forgot, Congrats Jack.

    Congratulations Jack!

    😎

  • RE: Are the posted questions getting worse?

    Jack Corbett (10/1/2014)


    If you aren't on Twitter you may have missed that Jason Brimhall (SQLRNNR) got awarded MVP today.

    Brilliant and well deserved!!! Congratulations Jason!!!

    😎

  • RE: Are the posted questions getting worse?

    GilaMonster (10/1/2014)


    The promised picture

    This shows about the rear 1/4 of my desk, slap in the centre (left-right).

    Guess the only think to do is to mix a salty soup cup and...

  • RE: SSIS: Dynamically map metadata in a Data Flow Task

    Quick question, are there frequent changes in the schema/tables? If not, you are better off using the import export wizard to create the packages and edit as needed. To dynamically...

  • RE: Ranking

    Toreador (10/1/2014)


    Eirikur Eiriksson (10/1/2014)Wrong assumption, nothing wrong with the question.

    If you think that then I suggest you re-read the question!

    I'm intrigued by this comment, could you elaborate further?

    😎

  • RE: Ranking

    happycat59 (9/30/2014)


    As far as I am concerned, this is another dodgy question. The sample data includes 4 rows only. Personally, I read the suggested answer and treated the...

  • RE: Ranking

    Thanks for the question Steve.

    Misread the 1, 2, 3, 3, 4 as 1, 2, 3, 4 and of course ticked row_number:pinch: Off for making more industrial strength espresso

    😎

  • RE: How Many Different Random Numbers?

    TomThomson (9/30/2014)


    Stewart "Arturius" Campbell (9/30/2014)


    Ed Wagner (9/30/2014)


    I don't mean to spark a mathematical debate here, but what is truly random anyway? 😉

    Randomness leads to unpredicatable outcomes, very much as depicted...

  • RE: How Many Different Random Numbers?

    hakan.winther (9/30/2014)


    Eirikur Eiriksson (9/30/2014)


    Thank you for the question Amit.

    Given options of 0,2 and 20 with the set's cardinality of 20 makes this kind of obvious; the granularity of syscolumns is...

  • RE: How Many Different Random Numbers?

    Thank you for the question Amit.

    Given options of 0,2 and 20 with the set's cardinality of 20 makes this kind of obvious; the granularity of syscolumns is {object,column}, one can...

Viewing 15 posts - 6,901 through 6,915 (of 8,760 total)