none
How to delete specific user timesheets using SQL query? RRS feed

  • Question

  • We face an issue with a specific user timesheet where a "recall" action hangs on a "loading" state forever.
    Our intention is to recall then delete the timesheet and ask the user to reenter it.

    Is there a safe SQL query to delete a specific timesheet from the database?

    I know how to retrieve the UUID of the timesheet using the following SQL query on the Reporting db:
    ---------------
    select TimesheetUID, T.TimesheetName, TS.Description, res.Resourcename, tp.periodname, tp.StartDate, tp.Enddate
    from MSP_Timesheet T
    inner join MSP_TimesheetStatus TS
    on t.timesheetstatusID = ts.timesheetstatusID
    inner join MSP_TimeSheetResource Res
    on Res.parentresourcenameuid = t.ownerresourcenameUID
    inner join MSP_TimesheetPeriod TP
    on t.perioduid = TP.perioduid
    where res.resourcename like '%<resource name>%' --find the resource
    and tp.periodname like '%<period name%' -- specify the period name, refer to Server Settings > Time Reporting Periods
    order by periodname
    ---------------

    Would you have a query to actually delete the timesheet using the TimesheetUID?

    Thank you for your assistance.


    Eric


    • Edited by ericdem Tuesday, September 24, 2013 1:14 PM
    Tuesday, September 24, 2013 1:12 PM

Answers

  • Thank you James,
    In fact we did try acting as delegate but got the same issue.

    Please note we resolved it by cancelling related jobs, and then were able to Recall the timesheet.
    Thank you for your input.


    Eric

    Thursday, September 26, 2013 8:22 AM

All replies

  • Any direct action against any project database is not considered as safe.

    Why you need to delete the timesheet using SQL query?


    Hrishi Deshpande – Senior Consultant DeltaBahn
    Blog | < | LinkedIn

    Please click Mark As Answer; if a post solves your problem or Vote As Helpful if a post has been useful to you.This can be beneficial to other community members reading the thread.

    Tuesday, September 24, 2013 7:34 PM
    Moderator
  • Hello Hrishi,

    We want to rectify the content of a submitted timesheet but the "Recall" hangs forever on "Loading...".
    I thought that deleting the timesheet to recreate it would be the best approach to possibly fix underlying issues with the timesheet.
    Would you suggest another approach?
    We use MSPS 2010.

    Thank you for your assistance.


    Eric

    Wednesday, September 25, 2013 7:50 AM
  • Eric,

       Hrishi is correct - if you execute anything against your database you will void your Microsoft support :(

    I would:

    1. Run a SQL Profiler session, and monitor the database locks while you attempt to recall the timesheet to ascertain what is holding up the show - maybe you can isolate a deadlocking process that is causing the hang on the SQL server side.
    2. It you can't resolve it I would open a case with Microsoft Support and if they suggest it then you can execute something against your database, and maintain support.

    Cheers,

       J.


    James Boman - http://www.boman.biz Software Consultant for IPMO - http://www.ipmo.com.au

    Wednesday, September 25, 2013 8:25 AM
  • Thank you James for your input.

    To better describe the concern we get a Status error and when we try a "Recall" it hangs forever:



    Eric

    Wednesday, September 25, 2013 8:36 AM
  • Eric,

        If while acting as a delegate you go to Manage Timesheets, and highlight the row and click recall to you get the same problem?

    (Screenshot is 2013 - but same screen exists in 2010)

    Cheers,

       James.


    James Boman - http://www.boman.biz Software Consultant for IPMO - http://www.ipmo.com.au

    Wednesday, September 25, 2013 11:53 PM
  • Thank you James,
    In fact we did try acting as delegate but got the same issue.

    Please note we resolved it by cancelling related jobs, and then were able to Recall the timesheet.
    Thank you for your input.


    Eric

    Thursday, September 26, 2013 8:22 AM