Forum Replies Created

Viewing 15 posts - 2,341 through 2,355 (of 7,191 total)

  • RE: Find out the shift Time

    You're looking for times that are between ShiftStart and ShiftEnd. However, if ShiftStart is after ShiftEnd, as it is in your first two rows, that condition will never be...

  • RE: sp_executesql and howto return rowcount

    You need to declare @result at the start of your code and reverse the order of the variables in the last line. Example C on this page shows you...

  • RE: Handover file import to user

    Put all the users into a domain group. Give that group write access on the folder from which the file is imported. Change the job so that it...

  • RE: Index on table with 70+ million rows

    Just before the table is truncated, use the index use DMVs to find out which are the most useful indexes. Do this on several consecutive days, until you've got...

  • RE: Index on table with 70+ million rows

    If you're truncating your table every day then you're starting with an empty table. I can't think of any reason, therefore, why you'd want to rebuild your indexes at...

  • RE: Warning messages in SQL Agent log to deactivate job schedule

    When do you get those messages - is it when you try to disable the job schedule from within a jobstep in the job? Why not just set the...

  • RE: What is difference between both query?

    I'm going to have to disagree there, I'm afraid. Suppose the query had originally been written with an outer join, with the filter (quite correctly) in the join predicate,...

  • RE: What is difference between both query?

    There's no difference. But don't take my word for it - compare the execution plans and see for yourself.

    Now, if the join were an outer (instead of inner) join,...

  • RE: How can restore deleted sql job

    If you don't have a backup, and you didn't have the job scripted out, then I'm afraid you've lost it. The sysjobhistory entries will only show that the job...

  • RE: power script to find backup status in sql server

    Jeff

    Does your job highlight just jobs that failed, or does it include those that didn't run, perhaps because they were accidentally disabled, or because SQL Server Agent wasn't running?

    I think...

  • RE: Index INCLUDE

    Since included columns don't form part of the actual index key, it's unlikely they'll be useful in WHERE clauses, JOINs and so on. What they are useful for is...

  • RE: Last day of month in a WHERE clause

    I still can't get it to work on my data set - I've clearly done something wrong, and I don't really have time to investigate. Looks like I've been...

  • RE: Last day of month in a WHERE clause

    WITH -- Itzik Ben-Gaan's virtual tally runs fastest and I don't know why.

    L0 AS (SELECT con vert(int, 1) AS C UN ION ALL SELECT con vert(int,1)),--2 rows

    L1 AS (SELECT 1...

  • RE: Last day of month in a WHERE clause

    Ah yes - good spot! It still gives totally different results from the other queries, though - possibly because of those pesky time portions that you mentioned.

    John

  • RE: Last day of month in a WHERE clause

    The Dixie Flatline (8/11/2016)


    IF you can afford a nonclustered index on check_date, this will drastically reduce the i/o.

    ;with Eomonths (Eom) as (select top(500) EoMonth(DateAdd(MONTH,(N-1),'1/1/2016')) from tally)

    select Eom as Check_date, Total

    from...

Viewing 15 posts - 2,341 through 2,355 (of 7,191 total)