Forum Replies Created

Viewing 15 posts - 1,741 through 1,755 (of 5,841 total)

  • RE: Incorporate several queries in 1

    Can't you just do something like this:

    SELECT IceRink,Country_IceRink, Name, Gender, Country_Persons, Time, Distance

    FROM TbExample

    WHERE (Distance = '500' and Gender = 'Man' )

    OR (Distance = '1000' and Gender = 'Man' )

    OR...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Incorporate several queries in 1

    Please provide sample rows and sample output. I would think at a minimum you would need to include the gender and distance columns so you can specify what the...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Issue with NUMA, Buffer Cache, and Connection pooling on 4S Westmere

    Don't have time to dig into it right now, but over the years and versions there have been any number of buffer-flushing bugs hit SQL Server. Some of them...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Compare rowcount between two tables with 10k rows

    P.S. If number of tables can possibly vary i'd better opt to FULL JOIN instead of LEAD /LAG.

    I don't think FULL JOIN would be required. LEAD/LAG should still work...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Compare rowcount between two tables with 10k rows

    Look up the LAG or LEAD keywords in Books Online.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: truncate table not good idea for production

    Use the right tool for the job. Sometimes that means truncating and (re)loading from scratch is best. Sometimes you don't KNOW what changes to apply so you have...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Combinate indexes

    Adding to the good stuff Grant wrote, be sure you search ALL of your "source code" for each index name you may intend to DELETE!! Failure to do so...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL AlwaysOn Failover Due to Missed Heartbeats

    DB1 32.24219 67.87012 0 <-- 68%

    DB2 739.4922 94.87454 0 <-- 95%

    DB1 just has a tiny tlog file. It may or may not need to be bigger. 68% full...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Help with Stored Proc

    cre8tivedaze (12/13/2014)


    Thanks for that Kevin. The thing is, the resulting output table will need to be dynamic in the sense that as the database grows (i.e. more years of data)...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Help with Stored Proc

    Ahh, my favorite TSQL word comes into play here: CASE

    Try working something like this into your query:

    SUM(CASE WHEN year = 2012 then a.totalWords else 0 end) AS 2012TotalWords,

    SUM(CASE WHEN...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL AlwaysOn Failover Due to Missed Heartbeats

    Also, I checked the size of the transaction log files, and it's not that big. We have a transaction backup job running every 20 mins, which will shrink the log...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: A Spectacular Case of 100% CPU Caused by Online Reindexing

    Plan guides don't help with data-value-skew-induced poor performance resulting from a good plan for one input(s) being a (horribly) bad plan for other input(s) either.

    I suppose we will...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: A Spectacular Case of 100% CPU Caused by Online Reindexing

    One solution is to add to the particular sensitive query an "optimize for" hint and supply a known value that gives the desired plan.

    Or use "optimize for unknown", so the...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: A Spectacular Case of 100% CPU Caused by Online Reindexing

    1) I recommend investigating Trace Flag 2371, which lowers the row mod count trigger for auto stats updates for larger tables.

    http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx

    2) No matter what you do this scenario almost certainly...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL AlwaysOn Failover Due to Missed Heartbeats

    1) Makes me twitchy to see those types of network stack errors in the Cluster Validation Report

    2) I would watch out for uncommitted transactions causing a backup in the tlog...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 15 posts - 1,741 through 1,755 (of 5,841 total)