Forum Replies Created

Viewing 15 posts - 931 through 945 (of 2,458 total)

  • RE: Find a String in a String

    quagmired (3/17/2016)


    Jeff Moden (3/17/2016)


    quagmired (3/17/2016)


    My personal favorite is, given the same accuracy, which ever is the fastest and least resource intensive. That's usually not REGEX as called from SQL...

    "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 a String in a String

    Steve Jones - SSC Editor (3/10/2016)


    PATINDEX is powerful, without a doubt. I have more of a fondness for charindex, mostly because I can indicate a start position. However, as Luis...

    "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: Avoid Blank Values in a column

    IF OBJECT_ID('tempdb..#yourtable') IS NOT NULL DROP TABLE #yourtable;

    CREATE TABLE #yourtable

    (

    c1 varchar(10) NOT NULL,

    c2 varchar(10) NOT NULL,

    c3 varchar(10) NOT NULL,

    c4...

    "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: Avoid Blank Values in a column

    You'll need to add a CHECK Constraint. The code will look like:

    ALTER TABLE <yourtable>

    ADD CONSTRAINT ck_constraintname

    CHECK (column <> '')

    "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: LIKE with 2 searches

    Try

    WHERE Item LIKE '%S' OR Item LIKE '%B'

    "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 - The conversion of a varchar data type to a datetime data type resulted in an out-of-range value

    Tell us what you're trying to do and I but someone can come up with a solution which that requires less code and performs much better. All that CASTing and...

    "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 a String in a String

    Good article Steve. I think you under sold the power of PATINDEX...

    CHARINDEX can start at a certain position in the string while PATINDEX can take wildcards. In this simplistic case,...

    "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: Career Advice, Oracle or SQL Server?

    There's advantages to mastering Microsoft and advantages to diversifying your skill set. The great thing is that data is hot so, as long as your skills are growing, your career...

    "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: Split string into multiple entries based upon known static length

    mciesiensky (3/8/2016)


    Sorry. Took me a minute to see the "t.n" in the code. Added that to my output and I think that will work.

    Now to convert that 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: Can you create an index that has an expression ?

    You can also create an indexed 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

  • RE: Trust, or Verify – How FKs Can (or Cannot) Help Performance

    Really great work Hugo.

    "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: generate unique id for each row within a range

    bismsit.29 (3/3/2016)


    Hi Alan,

    Thank you very much for replying back so early.

    Its sort of a business requirement that's why i want to reuse them also this value can hold till 99999...

    "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: Shredding with XML schema and XML data in one XML column

    This link should help get you started:

    https://msdn.microsoft.com/en-us/library/ms188282.aspx

    If you post some ddl and sample data we can demonstrate on that.

    "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: Roll Your Own Fuzzy Match / Grouping (Jaro Winkler) - T-SQL

    ip7915 (3/4/2016)


    The CLR implementation found in the assembly Microsoft.MasterDataServices.DataQuality, can be used in SQL and it is about 300 times faster..

    Yep. And if you have DQS setup it's already available...

    "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: Showing Quarters Dynamically

    Duplicate thread. Direct any esponses to http://www.sqlservercentral.com/Forums/Topic1766578-3412-1.aspx

    "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 - 931 through 945 (of 2,458 total)