Forum Replies Created

Viewing 15 posts - 1,306 through 1,320 (of 2,458 total)

  • RE: Query Execution plan too long

    thenewbee (7/23/2015)


    Sorry that I couldn't post my plan here. I agree to Luis C. and decided to go step by step.

    I wanted some experts commenting how to analyze a very...

    "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 delete tables in a database whose table names match a criterea

    Yeah, that won't work...

    This is something you can accomplish using Dynamic 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: two indexes on same column

    For the life of me I can't think of a scenario why you would not want just a clustered unique index and drop index #2, anyone think of any scenario...

    "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: Query Execution plan too long

    I bet if you post the plan here that we can take a look at it and get an idea of what is killing your performance.

    "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: array variables in sql server?

    Alvin Ramard (7/22/2015)


    I vote for either temp table or table variable.

    Yep.

    "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: array variables in sql server?

    Out of curiosity, has SS array support improved in any way since 2008?

    Yep, in 2012 they included CHOOSE.

    I never see it used though....

    Hmmmm, now I'm curious to how it...

    "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: Conver Number to string ( exp. 9 - 0009 or 9 - 09)

    mak101 (7/2/2015)


    How about

    RIGHT(REPLICATE('0',@size) + CAST(@value as varchar(max)),@size)

    I was thinking the same thing (maybe not varchar(max) 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: SQL Performance Issue

    Some DDL for the tables and underlying objects involved would be helpful. Note the link in my subject line.

    Also, could you include the query plan that this query generates?...

    "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 SP from Select sp_name from table

    There's nothing attached. Keeping in mind I don't know how values are being assigned to what your stored procs are ingesting you could do something like this:

    -- sample table using...

    "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: Necessary tools, helpful sites

    You are on the right track. SSDT is the new BIDS. Notepad++ is still essential ;-).

    My personal opinion is to learn/freshen up on XML; knowing XML has been extremely...

    "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 don't these two queries return the same number of records?

    Unless I'm missing something there's no reason to believe that that the two queries that you posted should return the same number of records.

    I wanted to know if maybe we...

    "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: tempdb log space usage troubleshooting

    SQL Guy 1 (7/21/2015)


    Thanks a lot, Vincy. Checkpoint greatly helped me. I was running it just once, and it was enough to bring it to 0%, though it took...

    "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: tempdb log space usage troubleshooting

    60% may not be big deal. You can keep an eye on it using DBCC SQLPERF(LOGSPACE).

    If you consistently see that the tempdb log is filling you will want 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: Table(s) design for messaging functionality

    You may want to consider adding a Subject field and an EmailChain ID field. Most applications that provide this type of functionality include a subject line. An EmailChain ID 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: table size difference in two DB

    mailtoashokberwal (7/20/2015)


    I am having an issue in determining the correct size of a table.

    I have a tableA in some DB on transaction server (Enterprise Edition), this table is being...

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