Forum Replies Created

Viewing 15 posts - 1,726 through 1,740 (of 2,462 total)

  • RE: The limits of SQL 2008 Replication

    For DR and Reporting purposes you old use replication but I don't think it's the best solution. You would have a lot of publishers to deal and a lot...

    "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: Second Friday of every month

    First, Louis' solution is brilliant; I tried for a couple hours to come up with something faster (that does not utilize a calendar table) and failed.

    So here's my calendar...

    "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: Second Friday of every month

    dwain.c (3/11/2015)


    This is quite easy to do if you already have a calendar table that stores that information:

    Calendar Tables in T-SQL[/url]

    The GenerateCalendar FUNCTION included in that article shows 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: Second Friday of every month

    andyscott (3/11/2015)


    How about this group of ctes? The first cte creates a table of Dates for the current year, the second cte expands these to add the Year, Month 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: SQL

    To get help faster include some DDL (note the link in my signature).

    In the meantime I would suggest that you avoid using ORDER BY <number> and use ORDER BY <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: Stored procedure to read XML

    I don't really understand your question and could not help you without any DDL.

    That said, note the XML below. I created two variables, the first with the old XML...

    "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: Slow Table Performance

    dschubel (3/6/2015)


    I have a table that is part of a Suite CRM installation. It Contains approx 1.5 million rows. When I do a "Select all rows" in SSMS it take...

    "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: Trying to generate a parallel execution plan

    mister.magoo (3/5/2015)


    Alan.B (3/5/2015)


    Mr. Magoo... If you are out there perhaps you could chime in:w00t: you know much more about this than I do...

    Wow, I appreciate the kind thought, but 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: Dynamic Return type in a function

    Jeff Moden (3/5/2015)


    Alan.B (3/5/2015)


    Chris, Jeff...

    If I understand the OP correctly, they could not solve this problem with ISNULL or COALESCE alone because of the awkward data type requirement.

    Let's review...

    "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: Trying to generate a parallel execution plan

    Oh dang! It does not appear that makeparallel() will help you get a parallel plan here...

    First, here's a little background on the function:

    Some time ago Paul White wrote an amazing...

    "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: Need help with pivot table in SQL server

    See these two articles by Jeff Moden:

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]

    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs[/url]

    "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: Searching to see if an XML node exists

    No problem. I too have been there ripping my hair out on SQL-XML namespace issues. 😉

    "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 SQL Challenege: TSQL Query Maximum Concurrent Connections (Participants)

    Itzek Ben-Gan has some clever SQL Server 2012 and non-2012 solutions for this type of problem in his book, Microsoft® SQL Server® 2012 High-Performance T-SQL Using Window Functions

    I have not...

    "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: Trying to generate a parallel execution plan

    The query optimizer does not always get it right but seems to correct more often that not provided that your system is configured correctly. MAXDOP(0) won't do anything for you...

    "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: Searching to see if an XML node exists

    ... and for a bonus answer. Because of the XML data structures/schemas I deal with I can get away with the lazy guy technique of "*:". This is not a...

    "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,726 through 1,740 (of 2,462 total)