Forum Replies Created

Viewing 15 posts - 856 through 870 (of 2,458 total)

  • RE: Replace a capital letter in a string

    You could also do this:

    REPLACE(value, char(88), '/')

    "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 issues with DENSE_RANK(). Is there a better alternative?

    tarr94 (4/6/2016)


    Thanks for the responses!

    Jacob, you're right, I missed something when pasting my sample data. I've corrected it in the original post.

    Lynn, I may end up doing exactly 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: Would You Move For a Job?

    Steve Jones - SSC Editor (4/5/2016)


    Was in SF last week. It's crazy expensive. I don't even like staying there when I visit. I've gotten to the point I'll stay near...

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

    Greg Edwards-268690 (4/6/2016)


    Brandie Tarvin (4/6/2016)


    Good morning, peeps.

    What are we having for breakfast today?

    Mine was oatmeal with purple honey (from North Carolina) and assorted fruit. But for some reason 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: You are a SQL Server developer who is...

    Luis Cazares (4/6/2016)


    Ed Wagner (4/6/2016)


    Iwas Bornready (4/6/2016)


    This is great. I didn't know this simple trick.

    This is a QOTD that's 3 1/2 years old.

    And this functionality is no longer guaranteed 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: Search Optomisation

    DesNorton (4/5/2016)


    Alan.B (4/5/2016)


    Interesting dilemma and great work with the sample data/ddl!

    Quick question what are the Partnumber column always going to be 6 characters long or less?

    Also (and 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: Are the posted questions getting worse?

    Phil Parkin (4/5/2016)


    Gail and I are gamely persevering with this one. I think my pressure limit has been reached now, though.

    "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: Adding totals for previous two days

    NP. 😀

    "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: Search Optomisation

    Interesting dilemma and great work with the sample data/ddl!

    Quick question what are the Partnumber column always going to be 6 characters long or less?

    Also (and I expect 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: Days a Specific Row is Active

    swansonm (4/5/2016)


    This would work if the termDate is the date of the term of that line/effective rate, but not since the termDate is actually the term date of the line...

    "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: About Index - Can we create a nonclustered index on clustered index column

    Indexing is a complex topic indeed. I huge part of the game is understanding how your server is using them. I always develop SQL with "Include actual Execution Plan" turned...

    "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: About Index - Can we create a nonclustered index on clustered index column

    It will increase performance if the index is used by the optimizer for SELECT statements. Say the column name is C1 and you execute: SELECT C1 FROM youratable......

    "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: Adding totals for previous two days

    Using GetNumsAB[/url], this may be better:

    WITH base AS

    (

    SELECT rn, d = DATEADD(DAY,n2,mn), mn = DATEADD(DAY,rn,mn), mx = DATEADD(DAY,n1,mn)

    FROM

    (

    SELECT...

    "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: Adding totals for previous two days

    If you had 2012 this would be much easier. I have to think about this a little; the most straight-forward solution is a "triangular join" that looks like this:

    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: Migrate Databases Report Server and Report Server tempDB

    WhiteLotus (4/4/2016)


    Hi All,

    I am about to migrate some databases consist of user databases and also Report server and Report server TempDB from 1 server to another server

    Question :

    The destination server...

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