Forum Replies Created

Viewing 15 posts - 1,081 through 1,095 (of 2,458 total)

  • RE: Why Scalar Functions Can Be Costly

    TheSQLGuru (1/4/2016)


    1) UDFs existed at least as early as SQL 2000: https://technet.microsoft.com/en-us/library/aa175085(v=sql.80).aspx

    2) This article fails to mention an EXCEPTIONALLY important flaw (among many others that aren't covered such as preventing...

    "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: Best solution for compounded update?

    robert-819720 (12/30/2015)


    Thank you so much Alan. A fascinating concept. I might be overly tired but just cannot figure out how to apply the concept to my situation. But will continue...

    "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: Syntax error in recursive cte

    Luis Cazares (12/30/2015)


    The following code should be removed for it to work.

    SELECT CONVERT(date,[dates]) AS Dates

    FROM DailyDates

    OPTION (maxrecursion 0)

    ),

    However, there's a major problem. You have a rCTE that counts which...

    "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: Best solution for compounded update?

    You can use the Quirky Update method discussed here: http://www.sqlservercentral.com/articles/T-SQL/68467/%5B/url%5D

    "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: Syntax error in recursive cte

    That END statement will cause an error if there is not a BEGIN statement somewhere before it within the same transaction. I'll just assume, however, that you have a BEGIN...

    "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 with a query, plz

    SQLisAwE5OmE (12/29/2015)


    Thnx again Jeff for trying. I am learning.

    You've come to the best place for people that are learning SQL IMHO.

    "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: Other Tools to Develop SSIS Package

    Stylez (12/29/2015)


    Good Morning Guys,

    ...is there a substitute tool that i can use so i can create my SSIS package with only my SQL Server 2012?

    Depending on what you are trying...

    "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 with a query, plz

    I'm guessing you would add this to the end of your query:

    WHERE Parent1_Gender = 'F' and Parent2_Gender = 'F'

    "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 Most Common Query Blunders...

    Eirikur Eiriksson (12/28/2015)


    Alan.B (12/28/2015)


    The most common/easiest to fix mistakes:

    Someone beat me to it but NOLOCK table hints are the #1 mistake I have seen. I would go so far as...

    "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 Most Common Query Blunders...

    The most common/easiest to fix mistakes:

    Someone beat me to it but NOLOCK table hints are the #1 mistake I have seen. I would go so far as to say it's...

    "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: EXECUTE permissions on a stored procedure

    The AD account is a member of an AD group that gives 'datareader' to this particular database. Would this be enough to execute the SP's that it does not have...

    "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: Get pick list from XML data file

    Giorgio Vidali (12/17/2015)


    One final thing I'd like to ask is.... considering that I will have to get more and more familiar with XML data... what is the best resource to...

    "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?

    "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: Hierarchies on Steroids #1: Convert an Adjacency List to Nested Sets

    I'm doing my first adjacency list to nested sets conversion and building out a rather complex hierarchy table for a new project (something I've been anxious to do since I...

    "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: Get pick list from XML data file

    Eirikur Eiriksson (12/16/2015)


    Alan.B (12/15/2015)


    another way...

    DECLARE @x XML = '<?xml version="1.0" encoding="UTF-8"?>

    <StaffingOrder>

    <OrderId validFrom="12/31/2015" validTo="12/31/2015">

    <IdValue>JNJNJP00040440</IdValue>

    <Status>Submitted</Status>

    </OrderId>

    <StaffingPosition>

    ...

    "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,081 through 1,095 (of 2,458 total)