Forum Replies Created

Viewing 15 posts - 256 through 270 (of 2,462 total)

  • RE: Filter single field using comma delimited criteria and delimitedsplit8k

    Jeff Moden's DelimitedSplit8K is the best in the business on pre-2012 systems and non-max data types; on SQL 2012+ I suggest DelimitedSplit8k_LEAD by Eirikur Eiriksson which is based...

    "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: Why Scalar Functions Can Be Costly

    t.ovod-everett - Friday, June 2, 2017 10:55 AM

    Phil Parkin - Monday, January 4, 2016 11:21 AM
    "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 learned something new today: # is a valid temp table name.

    CREATE TABLE #(id int);
    INSERT # VALUES (1);
    SELECT * FROM #;
    DROP TABLE...

    "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: t-sql 2012 parse out multiple values in one field that is varchar(1200)

    wendy elizabeth - Saturday, May 20, 2017 8:29 PM

    The following additional items:
    1. Can you explain --GROUP BY ALL Comment

    "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: SQL Query on Start & End Dates

    I did this on my phone and cant test this but i think this is what you need.

    With yourData (rn, Emp_ID, Hour_Type, Start_Date, Hours, End_Date
    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: t-sql 2012 parse out multiple values in one field that is varchar(1200)

    First for some sample data

    USE tempdb
    GO

    IF OBJECT_ID('tempdb.dbo.cannedPhrases') IS NOT NULL DROP TABLE dbo.CannedPhrases;
    IF OBJECT_ID('tempdb.dbo.GS') IS NOT NULL DROP TABLE dbo.GS;
    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: Heap vs Clustered Wildcard Search

    Joe Celko
    Please read a book on RDBMS. The identity column is not a column! It's a table property imposed by physical storage...


    This statement is 100% untrue. An...

    "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: How to create data with numeric ranges

    Ed Wagner - Tuesday, May 16, 2017 1:49 PM

    Alan, that's a cool ITVF.  I've used a similar approach when generating test data,...

    "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: Performance issue with EXCEPT

    Without Execution plans (you can just post them here, BTW, using the "Add File" link below) it's impossible to determine why each query is performing differently. In SQL server 2014...

    "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: How to create data with numeric ranges

    I posted this function about a year ago here. It takes for parameters:
    @low  = represents the lowest value for n1.
    @high = represents the highest...

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

    cbrammer1219 - Wednesday, May 10, 2017 1:47 PM

    I am wanting to do this with the least hands on as possible, I 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: Best practice

    Yes, SSIS is the best tool for this. 

    Depending on your SSIS skill level , you can also use the SQL Server Import/Export wizard (which uses SSIS). You would...

    "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: SSIS Data Flow vs SQL Stored Procedure Loop

    When moving need to perform insert/update based on primary key value.


    This sounds like a job for MERGE to me; there's no need for a loop...

    "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: Find highest number in a column of strings

    Well, if you have to use a function to strip the non-numeric characters then DigitsOnlyEE is the best way to go (something I was going to say until...

    "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: Case Expresion Then Containing String of Text and attribute result?

    If Serv.ID is numeric then you would have to convert it to a string first:
     Then 'Assessment' + ' - ' + CAST(Serv.ID AS varchar(10))
    Or, my favorite, CONCAT:

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