Forum Replies Created

Viewing 15 posts - 1,501 through 1,515 (of 6,036 total)

  • RE: Please help me improve the performance of this query

    Lynn Pettis (4/14/2016)


    Sean Lange (4/14/2016)


    Mike Frazer (4/14/2016)


    Thank you...attached.

    Edit: I added the DDL for the related objects as scripts.txt

    Those nested views are going to kill your performance something fierce. They...

  • RE: Query for Indexes needed - but not like I have found so far.

    Jeffery Williams (4/13/2016)


    Figured out solution. Still need to fine tune it but if it is useful to anyone here it is.

    You can change the DB name, I just have that...

  • RE: Why Query Optimizer doesn't reuse value

    Peter Shilovich (4/12/2016)


    NewID() doesn't matter in this case

    Actually NEWID() does matter in this case.

    Check the execution plan for

    Select

    Coalesce ((Select Value From Test Where ID = (Select ABS(CheckSUM(NEWID()) / 100000000))),...

  • RE: Actually need to use ? in Where clause

    Are you sure those are actually question marks?

    Those might be characters not from your default code page.

    Because you import some sort of unicode strings into varchar columns those characters are...

  • RE: Problem with Simple Unique Record Insert

    Did you try to run the EXISTS part separately?

    What does it return?

    Select * from Tracer Where TracerNo='1Z9306X40344831'

  • RE: Varchar usage

    dan-572483 (4/13/2016)


    On the other hand, I recently read an article about a person having all kinds of problems in life because his last name is longer than the 36 characters...

  • RE: Age between two dates in Years Month Days format (not typical one)

    BTW,

    Can you please explain the logic of this?

    DateFrom='2010-02-02', DateTo='2011-03-11', Age= 1 Years, 1 Months 8 Days

    To me, these dates

    DateFrom='2010-02-02', DateTo='2011-03-02'

    have 1 year, 1 month and 0 days between...

  • RE: Age between two dates in Years Month Days format (not typical one)

    Calendar is not a thing for straight forward calculations.

    You need a smarter approach.

    1. Figure out the number of whole years between FromDate and ToDate

    2. Add those whole years to FromDate...

  • RE: I need a strange join, please help

    It looks line those 2 tables contain records about the same phone cals recorded by 2 different systems on opposite ends of the calls.

    Clocks on those systems might be...

  • RE: How to kill the sessions which are inactive or suspended?

    sestell1 (4/7/2016)


    I fully agree with others that this is a bad thing, and should not be done. Killing off a process can be dangerous and lead to headaches. ...

  • RE: Could it be Tempdb corrupt ?

    From the last comment by that link:

    the error does not appear if you add a clustered index to the temp table in question

  • RE: Optimize very frequent running SP

    from Accounts.RequisitionAccountAccess RAA with (nolock)

    inner join [GDML.eResults.DataStore].[Admin].[AllowedAccountUserAccess] AS AAUA with(nolock)

    on ((RAA.AccountID = AAUA.AccountID AND RAA.AddressID = AAUA.AddressID )

    OR(RAA.AccountID = AAUA.AccountID AND AAUA.AddressID = 0))

    inner join [GDML.eResults.UserStore].[dbo].[aspnet_Users] AS U...

  • RE: Optimize very frequent running SP

    CREATE TABLE [Admin].[AllowedAccountUserAccess](

    [ID] [bigint] IDENTITY(1,1) NOT NULL,

    [UserID] [uniqueidentifier] NOT NULL,

    [AccountID] [bigint] NOT NULL,

    [AddressID] [bigint] NOT NULL,

    CONSTRAINT [PK_AllowedAccountUserAccess] PRIMARY KEY CLUSTERED

    (

    [ID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY...

  • RE: Optimize very frequent running SP

    1st thing falling into my eye:

    inner join [GDML.eResults.DataStore].[Admin].[AllowedAccountUserAccess] AS AAUA with(nolock)

    on ((RAA.AccountID = AAUA.AccountID AND RAA.AddressID = AAUA.AddressID )

    OR(RAA.AccountID = AAUA.AccountID AND AAUA.AddressID = 0))

    needs to be

    inner join...

  • RE: query help --possibly dynamic?

    You need a cross-tab query.

Viewing 15 posts - 1,501 through 1,515 (of 6,036 total)