Forum Replies Created

Viewing 15 posts - 1 through 15 (of 65 total)

  • RE: change identity for int to bigint

    We just hit a similar (but way smaller) situation. Altering the size of a column in a large table is a giant pain.

    If possible, the best bet is to...

  • RE: Where's the Unit Testing?

    TomThomson (7/26/2016)


    Actually, the fundamental design problem in that case is that the developer hasn't a clue how to go about software development. If he started doing design with...

  • RE: Where's the Unit Testing?

    “Trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often. What you eat before you step onto the...

  • RE: Naming Is Hard

    Re - table names that are GUIDs...

    If this is a pre-configured database intended as part of a system/application "as is", then whoever did that was at least mildly insane.

    However, some...

  • RE: Sql Server Indexes - BTree Or B+ Tree

    Wikipedia has a good item on "B-Tree", which includes a quote from one of the original inventors - Ed McCreight (with Rudolf Bayer).

    The "B" in B-tree does not have a...

  • RE: Selecting the record with the “nearest” date

    DOH!

    There IS an upper bound - today!

    Therefore, try the following:

    create unique NONCLUSTERED index uixEndDate on <table> (IndexEndDate, PatientID);

    create unique CLUSTERED index ucixPatientEndDate on <table> (PatientID, IndexEndDate);

    Then, run the query using...

  • RE: Selecting the record with the “nearest” date

    John Mitchell-245523 (12/9/2015)


    Kim Crosser (12/8/2015)


    In similar situations, I found the following to work pretty well:

    SELECT PatientID, ...

    from dbo.MDTest tbl1

    where tbl1.IndexEndDate > @dParamDate

    and not exists (select 1

    from...

  • RE: Selecting the record with the “nearest” date

    In similar situations, I found the following to work pretty well:

    SELECT PatientID, ...

    from dbo.MDTest tbl1

    where tbl1.IndexEndDate > @dParamDate

    and not exists (select 1

    from dbo.MDTest tbl2

    ...

  • RE: Positive or Negative

    dietztm (11/30/2015)


    Your trigger (or auditing query) doesn't need to be visible to the user, it can just spam the devs until they fix it. Also talk to your boss about...

  • RE: Positive or Negative

    TomThomson (11/26/2015)


    I would have a simple approach to Kim's problem: inform management that the only reasonable way I - as a database person - could resolve this problem would be...

  • RE: Deadlock Help

    anthony.green (11/6/2015)


    UPDATEdbo.Cache

    SETAvailability = Availability - 1,

    LastUpdated = GETUTCDATE()

    WHEREUnitId = @UnitId

    ANDStartDate < DATEADD(DAY, @Duration, @StartDate)

    AND@StartDate < DATEADD(DAY, Duration, StartDate)

    ANDAvailability > 0;

    Any chance of getting them to recode this query to swap...

  • RE: Risks of NOLOCK, part 1

    I believe the initial results were an artifact of the "rollback". Unlike a truncate, which effectively removes the table data instantaneously, the rollback has to restore the state and...

  • RE: Table size and Index size

    Easy ways to create indexes using multiple times the actual table space:

    1. Create multiple indexes on MANY columns in the table (I have actually seen indexes defined that were...

  • RE: Risks of NOLOCK, part 1

    TomThomson (11/4/2015)


    However, the use of NOLOCK still increases both the worker time and the elapsed time. These are the results I get:-

    SP......... cached_time............exec count.. AvWorkerTime.. tot_wt...min_WT.. max_WT...AvElapsedTime. .tot_ET.. min_ET.....

  • RE: Risks of NOLOCK, part 1

    TomThomson (11/3/2015)


    So it seems that it is possible for use of NOLOCK to make a query run slower, instead of faster.

    Thank you for all the work here, but I think...

Viewing 15 posts - 1 through 15 (of 65 total)