Forum Replies Created

Viewing 15 posts - 4,861 through 4,875 (of 7,597 total)

  • RE: Metrics Table or Performance Tuning

    ChrisM@Work (8/25/2015)


    ScottPletcher (8/25/2015)


    ChrisM@Work (8/25/2015)


    ScottPletcher (8/25/2015)


    ChrisM@Work (8/25/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)

    The inner select can be accelerated with this index:

    CREATE INDEX ix_Helper ON [cts].[exception_Main]

    (productArea, reportable, reportYear, reportMonth, queueID)

    INCLUDE (volume, cost,...

  • RE: Metrics Table or Performance Tuning

    ChrisM@Work (8/25/2015)


    ScottPletcher (8/25/2015)


    ChrisM@Work (8/25/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)

    The inner select can be accelerated with this index:

    CREATE INDEX ix_Helper ON [cts].[exception_Main]

    (productArea, reportable, reportYear, reportMonth, queueID)

    INCLUDE (volume, cost, exceptionDateTime)

    But with...

  • RE: Metrics Table or Performance Tuning

    ChrisM@Work (8/25/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)

    The inner select can be accelerated with this index:

    CREATE INDEX ix_Helper ON [cts].[exception_Main]

    (productArea, reportable, reportYear, reportMonth, queueID)

    INCLUDE (volume, cost, exceptionDateTime)

    But with the best...

  • RE: Replace and Substring

    UPATE TblNAme

    SET DOB = substring(DOB,5,4)+SUBSTRING(DOB,1,2)+SUBSTRING(DOB,3,2)

    WHERE ISDATE([DOB]) != 1

    and DOB is not null

    and DOB <>''

  • RE: Interesting results with Len and varchar(max)

    Iow, be sure to cast at least one of the values in the expression to (max):

    select @t=cast('abc' as varchar(max)) + replicate('x', 2000) + char(10) +

    'abc' + replicate('x', 2000)+ char(10)...

  • RE: Fine tuning Queries

    Jeff Moden (8/21/2015)


    For too many reasons to explain here, SQL Server really, really likes NOT NULL, UNIQUE, ever increasing, narrow clustered indexes. A date time column can be very...

  • RE: Fine tuning Queries

    The key to best performance is the best clustering index.

    For what's shown, the only potential change that's needed is for the credit_application table. Perhaps it should be clustered on...

  • RE: Metrics Table or Performance Tuning

    ChrisM@Work (8/21/2015)


    ScottPletcher (8/21/2015)


    ChrisM@Work (8/21/2015)

    The inner select can be accelerated with this index:

    CREATE INDEX ix_Helper ON [cts].[exception_Main]

    (productArea, reportable, reportYear, reportMonth, queueID)

    INCLUDE (volume, cost, exceptionDateTime)

    But with the best clustered index...

  • RE: Metrics Table or Performance Tuning

    ChrisM@Work (8/21/2015)

    The inner select can be accelerated with this index:

    CREATE INDEX ix_Helper ON [cts].[exception_Main]

    (productArea, reportable, reportYear, reportMonth, queueID)

    INCLUDE (volume, cost, exceptionDateTime)

    But with the best clustered index now on...

  • RE: Metrics Table or Performance Tuning

    Interesting. Edit: The only reason that particular join should be slow is the large number of lookups, since the map_exception table only has a few hundred rows. End-Edit.

    At any...

  • RE: return the code that sp_MSforeachtable would produce

    drew.allen (8/19/2015)


    ScottPletcher (8/19/2015)

    Be careful. The ? is replaced with a fully delimited schema and table, such as:

    [dbo].[table1]

    I didn't realize that was the case. In that case my query...

  • RE: return the code that sp_MSforeachtable would produce

    Excellent point about the underscore, it definitely needs bracketed.

    Be careful. The ? is replaced with a fully delimited schema and table, such as:

    [dbo].[table1]

    Thus, a comparison like:

    IF ''?'' LIKE ''%[_]st''

    can...

  • RE: Account Number Transformation

    CREATE TABLE #AccountNum_Custom_Handling (

    AccountNum varchar(50) NOT NULL PRIMARY KEY,

    action_to_take char(1) NOT NULL

    CHECK(action_to_take IN ('D',...

  • RE: return the code that sp_MSforeachtable would produce

    You can use a PRINT to just print the command, then remove the print and the extra quotes when ready to run the commands.

    SET QUOTED_IDENTIFIER OFF; --this is implied by...

  • RE: Is is possible to 'restore' the database from the 'raw' .mdf and .ldf files of the old computer to the new computer / database

    SQL expert or not, I'd advise you to use a CREATE DATABASE ... FOR ATTACH command rather than using a gui. That way you have a record of exactly...

Viewing 15 posts - 4,861 through 4,875 (of 7,597 total)