Forum Replies Created

Viewing 15 posts - 4,816 through 4,830 (of 49,552 total)

  • RE: Recompiling

    More garbage from BoL, and trivial to test and prove false.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Blocking due to access_methods_scan_range_generator and Latch_Ex

    GilaMonster (9/1/2015)


    It's normal for sessions in parallel to 'block' each other.

    Now, maybe they shouldn't be running in parallel, maybe there are missing indexes, maybe there's badly written code. Either could...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: In this database mirroring scenario, what would you expect to happen?

    With the network down, you won't be able to do a controlled failover.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: In this database mirroring scenario, what would you expect to happen?

    If the connection between Site1 and Site 2 drops, principal will go offline (it doesn't have quorum), Mirror becomes new principal.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Application Development for SQL Server

    I'll second the suggestion of Lightswitch if you have no development experience. Learning to write a front end app from scratch is well beyond a forum step by step.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to get a sum of one set of data in the same column

    Then you should have mentioned that in your requirements. I can't read your mind.

    Replace the LEFT with CharIndex with just a LEFT(3), and the CASE checking for LEN >=3, assuming...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to get a sum of one set of data in the same column

    Jayanth_Kurup (9/7/2015)


    you need to use Group by ROLLUP

    Rollup generates a grand total row, which was not asked for. Easier to use Grouping Sets to just get the totals needed than...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Script Generate

    Jayanth_Kurup (9/7/2015)


    Find and replace will change the varchar to nvarchar but you still need to account for the increase in the column width now. I think dynamic sql might be...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to get a sum of one set of data in the same column

    Thanks for the sample data

    This does what you asked.

    CREATE TABLE #accounts (

    AccountCode NVARCHAR(10),

    AccountName NVARCHAR(50),

    Total INT

    ...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to send PARAMETER to a SQL JOB while calling

    Sure

    EXEC sp_start_job

    It takes the job name or ID, server name and step to start the job at as parameters.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to send PARAMETER to a SQL JOB while calling

    You cannot pass a parameter directly to a job, because jobs are designed to be run automatically on a schedule without user input. You'll have to do some workaround like...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to get a sum of one set of data in the same column

    Without a CREATE TABLE to easily test with (and it being around midnight), I suggest you read up on Grouping Sets, it should allow you to do what you want.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to get a sum of one set of data in the same column

    Please post create table statements and sample data in an easily usable form (insert statements). Personally I'm not going to download and open a strange excel file.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: TSQL Short-circuit

    mister.magoo (9/6/2015)


    Complete test script:

    To test this kind of thing, you need to have multiple batches, not a single batch with lots of statements. The reason these kinds of queries perform...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Issue with datetime

    https://msdn.microsoft.com/en-gb/library/ms187819.aspx

    Rounding of datetime Fractional Second Precision

    datetime values are rounded to increments of .000, .003, or .007 seconds

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 4,816 through 4,830 (of 49,552 total)