Forum Replies Created

Viewing 15 posts - 31 through 45 (of 2,462 total)

  • Reply To: string compare again .. :)

    Just as a side note, depending on how often your columns are updated/modified, you can always split the string ahead of time using a permanent tally table like this:

  • This reply was modified 6 years ago by Alan Burstein. Reason: fixed the word "don't" so the DML is not red
  • This reply was modified 6 years ago by Alan Burstein. Reason: Added Execution plans, additional notes
"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

  • Reply To: Longest Common Substring in an ITVF

    Jeff Moden wrote:

    I'm not seeing any code attached to your last post.  What code are you talking about being "attached"?

    x

     

     

     

     

     

     

     

    Grrr...

    /*********************************** PART #1...
    "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

  • Reply To: Longest Common Substring in an ITVF

    UPDATED 20200803 at 9:30PM

    Ok, 4 1/2 years later I have a something really good to show!

    This code is from one of many articles in various phases of completion which I'll...

    "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

  • Reply To: The Computing Revolution

    Great article Steve. Really informative.

    "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

  • Reply To: Regex Help

    I've just added CLR Regex Functions to our SQL Servers.

    I'm trying to replace some of our less efficient string parsing TSQL functions with the new .Net CLR Regex Functions.

    For things...

    "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

  • Reply To: Are the posted questions getting worse?

    If anyone is interested in a rather interesting problem has a look at this: https://www.sqlservercentral.com/forums/topic/table-function-returns-varying-number-of-records-for-an-update-statement

    I gave up.

    "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

  • Reply To: Table Function returns varying number of records for an update statement

    I'm really curios to what is happening internally for the varying set of records that get updated.

    This is one of the more interesting problems I've seen in a while on...

    "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

  • Reply To: Table Function returns varying number of records for an update statement

    To  quote Ned Flanders, "Wow! As melon scratchers go, that's a honey doodle."

    I can confirm that I see the same issue and racked my brain trying to figure out how...

    "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

  • Reply To: Extract Blocks of Number

    Jonathan AC Roberts wrote:

    Alan Burstein wrote:

    Grab a copy of NGrams8k and you can do this:

    Declare @Temp Table(SomeId INT IDENTITY, [Data] VarChar(8000))

    Insert @Temp ([Data])
    Values('hello my name is john 07999999999 smith 07888888888...
    "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

  • Reply To: Extract Blocks of Number

    Grab a copy of NGrams8k and you can do this:

    Declare @Temp Table(SomeId INT IDENTITY, [Data] VarChar(8000))

    Insert @Temp ([Data])
    Values('hello my name is john 07999999999 smith 07888888888 this last...
    "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

  • Reply To: Understanding Outer Joins in SQL

     

    This is an inner join, and is an intersection of the data in the tables. This is shown in the image below.

    Careful here. An Inner Join and an Intersection are...

    "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

  • Reply To: SELECT processed before WHERE clause

    The order of processing is as follows:

    FROM

    WHERE

    GROUP BY

    HAVING

    SELECT

    ORDER BY

    LIMIT

    LIMIT is MySQL not SQL Server. The last three things to be processed are : SELECT then TOP / OFFSET then ORDER...

    "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

  • Reply To: t-sql 2012 cross join

    I do not understand the benefit of using a 'cross join' versus an 'inner join' on the sql above pointing to the same table?

    There is no "benefit", it's a design...

    "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

  • Reply To: Views vs. UDFs vs. Stored Procedures for Data Warehouse Reports

    imani_technology wrote:

    This is good information.  My question now is, why even use a UDF as a source for a report?  Why not just have the report user access a view...

    "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

  • Reply To: Views vs. UDFs vs. Stored Procedures for Data Warehouse Reports

    First, as a general rule: when considering user defined functions (UDFs) the most important thing is if the function is inline or not. If performance is important, the only viable...

    "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 - 31 through 45 (of 2,462 total)