Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Lancashire UK

    Question Unanswered: Tracing or Debugging a procedure

    I have a very simple piece of code (see below) which when executed sometimes takes around 7 minutes and sometimes around 3.5 hours. the difference is that during the 3.5 hours there is a lot of querying of the table being updated. But I don't know how to find out if this is the case. How can I find out whether my process is waiting (for locks or for any other reason) - is there a trace or debug facility within the tandard Microsoft Toolset which I can use.


    Problem code below
    print 'Updating stm_brnline - Start time is ' + convert(char(25),getdate(),113)
    update m
    set m.branchpgrade = s.branchgrade
    from stm_brnline m, tmp_brngrades s
    where m.traddiv = s.traddiv and
    m.contcode = s.contcode and
    m.merchsect = s.merchsect and
    m.branch = s.branchcode
    print 'Updating stm_brnline - End time is ' + convert(char(25),getdate(),113)

  2. #2
    Join Date
    Jun 2003

    Thumbs up

    Use sql Profiler.Enterprise manager--> tools--> Sql Profiler
    I love cursor,though I never use it.Cos' I dont want to misuse it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts