Forum Replies Created

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

  • 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

  • RE: bug in SQL Server view

    Robin35 (6/17/2015)


    thanks for the reply.

    yeah refreshing the view will solve the issue but when i query the view after adding a column to table, i get the following result.

    c1c2total

    533RobinNULL

    655SteveNULL

    Column Total...

    "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: bug in SQL Server view

    <Duplicate Post Removed>

    SSC Bug? :hehe:

    "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: Culture Clashes and Arrogance

    Great Post Andy.

    I have been everything from a DBA at a bank and in the Healthcare industry where there are the tightest controls imaginable and I have worked 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: bug in SQL Server view

    This is a classic "it's not a bug, it's a feature" things...

    This is one of those funky MS SQL Server View behaviors. Because the view is not Schema Bound...

    "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,458 total)