Forum Replies Created

Viewing 15 posts - 4,561 through 4,575 (of 8,761 total)

  • RE: T-SQL Query to get the Month wise data

    Quick suggestion

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    /* Sample data from OP */

    DECLARE @EXISTING TABLE

    (

    [Month(YYYYMM)] INT NOT NULL

    ,Department...

  • RE: SQLCMD Mode; Run all SQL files in a directory

    Thank you Jason for this write up, very good reference indeed!

    😎

  • RE: Alter login mean?

    vsamantha35 (9/13/2015)


    Hi All,

    What does the command do or what does it mean? When do we use it?

    Alter login [<loginname>] with name = [<loginname>];

    Thanks in advance.

    ALTER is a short-cut for...

  • RE: SQL Server Start Problem.

    Have you checked the [Install dir]\MSSQL\Log\ERRORLOG file?

    😎

  • RE: Today's Random Word!

    Ed Wagner (9/13/2015)


    whereisSQL? (9/12/2015)


    Ed Wagner (9/11/2015)


    BWFC (9/11/2015)


    Ed Wagner (9/11/2015)


    Eirikur Eiriksson (9/11/2015)


    anthony.green (9/11/2015)


    whereisSQL? (9/10/2015)


    Ed Wagner (9/10/2015)


    DonlSimpson (9/10/2015)


    Ed Wagner (9/10/2015)


    djj (9/10/2015)


    Ed Wagner (9/10/2015)


    whereisSQL? (9/10/2015)


    Luis Cazares (9/10/2015)


    Universe

    He-Man

    Conan

    Sword

    Katana

    Samurai

    Shogun

    Shaolin

    Monastery

    Hermetic

    Seal

    Karate Kid

    Wax

    Shine

    Shoe

    Walk

  • RE: Optimisation of unpivot/insert code

    Jeff Moden (9/13/2015)


    Because it's still an estimate of cost, I don't trust even the Actual Execution Plan when trying to determine which code will be faster or use fewer resources....

  • RE: List from 1 to @AnotherNumber

    There is a subtle difference between these two queries, when measured back to back on 10^6 numbers then the former is around 25% faster than the latter although the difference...

  • RE: Round

    For fun

    😎

    SELECT ROUND(0.999,-1);

  • RE: Commercial Software with All Tables as Heaps and Terrible Performance

    Using heap to speed the inserts is like a very bad Credit Card deal, no transaction fees but X000% Annual interest rate:pinch:

    😎

    Jeff Moden (9/12/2015)


    It's a really good thing that...

  • RE: Insert statement - Max(FIELD)+1 how to deal with if MAX(FIELD) = NULL

    chetta (9/12/2015)


    Hello,

    I have an insert statement similar to:

    insert into dbo.CHILD (ChildMotherID, ChildNo)

    values

    (

    (select MotherID from dbo.Mother where MotherName = 'Suzie Q'),

    (select max(ChildrenAmt)+1 from dbo.Children where ChildrenMotherID =

    (select MotherID from...

  • RE: passing Multi-valued parameter to a stored procedure

    Two quick suggestions, first uses the DelimitedSplit8K function for a simple delimited list of parameters and the second uses XML for more complex parameter structure.

    😎

    Simple parameter string

    USE tempdb;

    GO

    SET NOCOUNT ON;

    GO

    IF...

  • RE: Optimisation of unpivot/insert code

    pietlinden (9/11/2015)


    Something like...

    CREATE TABLE Actuals (

    FY INT

    ,P1 SMALLMONEY

    ,P2 SMALLMONEY

    ,P3 SMALLMONEY

    ,P4 SMALLMONEY

    ,P5 SMALLMONEY

    ,P6 SMALLMONEY

    ,P7 SMALLMONEY

    ,P8 SMALLMONEY

    ,P9 SMALLMONEY

    ,P10 SMALLMONEY

    ,P11 SMALLMONEY

    ,P12 SMALLMONEY

    CONSTRAINT pkActuals PRIMARY KEY (FY)

    );

    GO

    -- insert some dummy values...

    INSERT INTO dbo.Actuals(FY,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P2)

    --...

  • RE: List from 1 to @AnotherNumber

    Quick suggestion with inline tally table

    😎

    DECLARE @BoxesNeeded INT = 15;

    ;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))

    , NUMS(N) AS (SELECT TOP(@BoxesNeeded) ROW_NUMBER() OVER (ORDER...

  • RE: Mobile friendly version of SSC

    Steve Jones - SSC Editor (7/23/2015)


    We have debated about it. There is a significant amount of work for some parts of the site. We do have a mobile QotD that...

  • RE: Thoughts on comparing two result sets

    Quick suggestion

    😎

    /* Safe place */

    USE tempdb;

    GO

    SET NOCOUNT ON;

    GO

    DECLARE @METADATA TABLE

    (

    ReportID ...

Viewing 15 posts - 4,561 through 4,575 (of 8,761 total)