Forum Replies Created

Viewing 15 posts - 1,336 through 1,350 (of 2,462 total)

  • RE: Are the posted questions getting worse?

    SQLRNNR (6/30/2015)


    Alvin Ramard (6/30/2015)


    Question is being asked in the forum: "if mdf get full by data then how to make free space without adding disk."

    Is it ok to suggest dropping...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    Thank you everyone for the kind words!

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    spaghettidba (6/29/2015)


    Congrats Alan! My second daughter turns 3 months on Friday and I can confirm that SQL stands for Sleep Quality Lowered in this case 😀

    Brilliant and so true!

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: PatReplace8K

    DonlSimpson (6/30/2015)


    ChrisM@Work (6/30/2015)


    Nice job, Alan.

    One question: what's the CHECKSUM() for? It doesn't appear to change the result from ROW_NUMBER().

    Same question.

    PatExclude8K and PatReplace8K evolved from the thread at the end...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    The posted answers should improve for awhile. A few days ago this happened:

    My brand new baby girl! My first baby. I took a month off of work and the...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: PatReplace8K

    sequelgarrett (6/29/2015)


    Why is the CASE statement necessary?

    I have to go through my notes, I can't remember at the moment and I don't have access to a PC. It had something...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: The Case for Specifying Data Types and Query Performance

    Great article Chad! I learned something new today.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Eliminating a Distinct SORT operation

    Answer removed, bad advice.

    I think I got to the bottom of this... Give me a few minutes...

    Ok I'm back. Again, DDL would really be helpful. Note the link in...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Eliminating a Distinct SORT operation

    lmarkum (6/19/2015)


    Here is the SQL and the attached sql plan

    DECLARE @SendId INT

    SET @SendId = 1

    UPDATEEmailTrackingSummary

    SETEmailName = tets.EmailName,

    SentDate = tets.SentDate,

    SendDate = tets.SendDate,

    NumberSent = tets.NumberSent,

    NumberDelivered = tets.NumberDelivered,

    Duplicates = tets.Duplicates,

    UniqueClicks = tets.UniqueClicks,

    UniqueOpens =...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Cannot perform an aggregate function on an expression containing an aggregate or a subquery

    ChrisM@Work (6/18/2015)


    You will find this much easier to work with if you can reduce the clutter, and one way of doing this is to encapsulate sections of the code into...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Size of Filtered Table

    I'm on my phone now, otherwise I'd provide an example....

    You could take the last backup and restore it somewhere else (a non-production machine preferably). Then you could create a...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Need code to list ID

    Another way...

    DECLARE @IDList VARCHAR(MAX);

    WITH yourtable AS

    (

    SELECT memberID FROM (VALUES ('001'),('002'),('003')) t(memberID)

    )

    SELECT @IDList = STUFF ((SELECT ','+memberID FROM yourtable FOR XML PATH('')),1,1,'');

    PRINT @IDList;

    GO

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Data Warehouse automation tool suggestions?

    Andrew P (6/17/2015)


    Thanks Thomas - I appreciate the offer, but not at the moment. I've had a read through the TimeXtender 2014 user guide and have somewhat of an idea...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Help! How to properly normalise a table from the start

    I agree with Alvin - don't use ambiguous column names like ID and Date. Instead go with Contact_ID and something like Create_Date. Economic Class can be it's own table with...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: scalar function returning zero when it shouldn't

    For even better performance I strongly suggest that you consider turning it into an Inline Table Valued Function and use SCHEMABINDING.

    There are many issues with scalar udfs including the...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 1,336 through 1,350 (of 2,462 total)