Forum Replies Created

Viewing 15 posts - 241 through 255 (of 389 total)

  • RE: No predicate join work around

    Is there a table which has both keys between productID and customerID?

    Me as an example will not have data against every product in your product table.

    I would maybe buy 1...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: No predicate join work around

    Why not do a select a.*,b.col1 from tableA a Cross join tableB b?

    How would a group of data in tableA relate to a group of data in table B?

    Give a...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Not returning results in Production environment

    will take a stab.

    You might need to have a limited user,X, created and then give access to each system table needed to each user X for each DB

    So this is...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Adding a value to a 'date' column caused an overflow

    You said 'loop'.

    What are you looping?

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: where clause in dynamic query

    try not to hard code your values in the string, else if the code runs with different parameter values, there will be zero plan reuse, unless forced parameterization is enabled.

    Use...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Increment date based on the time value automatically

    declare @i int,@T smallint

    select @i = 20100101

    Select @T=1900

    select dateadd(minute,@T%100,(dateadd(hour,@T/100,

    CONVERT (datetime,convert(char(8),@i))

    )))

    try this

    Edited to say that I am now confused so I am leaving initial attempt in here, but might not work...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Increment date based on the time value automatically

    Can you double check your expected datetime against the left column, some data does not look correct.

    Also, what does your initial attempt at coding this look like?

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: How to make actual execution plan better?

    ScottPletcher (6/30/2015)

    I've seen them actually more than double the table. I've seen NC indexes that total more than 5x the main table size! If someone was following DTA...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: How to make actual execution plan better?

    Tac11 (6/30/2015)


    HI Gurus,

    select * from Sales.SalesOrderDetail where SalesOrderDetailID = 6

    When I looked execution plan it gave me missing non clustered index suggestion on 'SalesOrderDetailID' even though it has PK!!!!

    The first...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Adding a value to a 'date' column caused an overflow

    this causes an overflow.

    So find out what the max ranking value is.

    declare @date date = cast(getdate() as date)

    select dateadd(mm,200000,@date) --OVERFLOW

    SELECT max(rownum) --WHAT IS THIS VALUE?

    FROM (

    SELECT viasatsubscriptionid, firstproductregistrationdate, salesdate, baseenddate,

    ROW_NUMBER()...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Extract Data from the given

    (a*w/100) *(prj(10517)+prj(10742)+prj(10804)+prj(10808)+prj(10809)+prj(10810))

    I think this reduces the amount of multiplication operations to one by doing factorization, and also will probably reduce the error from having to round early.

    Other than that, without...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Deleting a file from file system. Worked before and now an error, strange.

    sp_configure 'show advanced options',1

    go

    sp_configure 'xp_cmdshell',1

    go

    reconfigure

    go

    declare @DeleteBackupFileStatement Nvarchar(400)= NULL,@BackupFile nvarchar(300)= '\\mypath\myfile.docx'

    BEGIN

    SET @DeleteBackupFileStatement = 'DEL ' + LTRIM(RTRIM(@BackupFile)) +' /Q'

    END

    PRINT '@DeleteBackupFileStatement: ' + cast(@DeleteBackupFileStatement as Nvarchar(400))

    BEGIN

    print @DeleteBackupFileStatement

    exec xp_cmdshell @DeleteBackupFileStatement

    END

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Multiple conditions in where clause will cause any performance issues ?

    I see varchar(MAX) for all the columns.

    You cant put index on it.

    The size limit is 900 bytes, so that is varchar900 or nvarchar450

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: How to select first name only ?

    do something like

    select left(Name,charindex(' ',name)) from mytable

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: CLR function performance difference same server different database

    Can you compare the content column from assembly, between the 2 DB's?

    When you do, are they exactly the same?

    IIf they are the same, what happens when instead of doing use...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

Viewing 15 posts - 241 through 255 (of 389 total)