Re: stored procedure takes too much time to execute

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yes, I could try that, but I'm not sure that this is the reason.
Even when I insert just 1 category, which means there is only 1 connection
with the database, it takes much too long to be executed.

But thx anyway for your help.
Nic


"HARI PRASD BARU" <HARIPRASDBARU@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:37E532EC-FA14-4283-A714-F6000B050BE7@xxxxxxxxxxxxxxxx
> Nicholas
> why don't u send only ProductID and entire categories string to
stored
> proc and do whatever operations u want there itself...which if of simpler.
> See if u have 3 categories and one product ID..3 times data has tobe
> transferred from Business layer/Presentation layer to Database ...which is
> depends on network speed...
> try writing stored procedure which capture prodID,catID's...
> write logic to split each catID and insert....
>
>
>
> "nicholas" wrote:
>
> > Thx.
> > It's indeed not the reason for the slowdown, but it works and its better
> > code.
> >
> > I tried to insert some time stamps in the code on several places:
> > response.write(now())
> > But the time is the same for each timestamp.
> > weird...
> >
> > thx again.
> >
> > "Phillip Ian" <phlian@xxxxxxxxxxx> wrote in message
> > news:1122987368.194395.80200@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > It's probably not the cause of your slowdown, but here's what Hans was
> > talking about re: re-using the command and param objects.
> >
> > Dim myCommand As New SqlCommand("spaddproductscats"­, myConnection)
> > myCommand.CommandType = CommandType.StoredProcedure
> >
> > Dim prodid As SqlParameter
> > prodid = New SqlParameter("@productID", SqlDbType.Int, 4)
> > prodid.Direction = ParameterDirection.Input
> > prodid.Value = ctype(request.querystring("pro­ductID"),integer)
> > myCommand.Parameters.Add(prodid)
> >
> > Dim catid As SqlParameter
> > catid = New SqlParameter("@categoryID", SqlDbType.Int, 4)
> > catid.Direction = ParameterDirection.Input
> > myCommand.Parameters.Add(catid)
> >
> > For i=0 to mycounter-1
> > catid.Value = MyArray(i)
> > myCommand.ExecuteNonQuery
> > Next
> >
> >
> >


.



Relevant Pages

  • Re: Turn off Auto Calculation
    ... Thx for your help ... The reason that the code I had used in the form did not work when attached to the button was because the 'Is Null' in the IIF statement had to be moved ... Perth, Western Australia ...
    (microsoft.public.access.forms)
  • Re: Problem converting byte[] to string
    ... Thx for your help in this. ... None of the decoders worked in System.Text namespace. ... > If it doesn't work for the ASCII one, then the encoding isn't ASCII. ... I was just wondering if any one new a reason as to why this ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Guitar With No Fret Markers - Design or On Purpose??
    ... Just a design option or is there a specific reason for not having them? ... thx - Craig ...
    (rec.music.makers.guitar.acoustic)
  • Re: post removal
    ... I will try to find a way out of this hole somehow... ... thx again, ... that is reason to get it straigtened out legally "threatened to pull ... jobs, you likely might ...
    (sci.med.nursing)
  • Re: 9100 mystic problem
    ... thx very much for your fast reply. ... installation of xp on a different partition of the hd which gave me ... your softwaresystem might be sick for some reason. ... Wipe your system and make a fresh reinstall of XP + SP2 ...
    (alt.sys.pc-clone.dell)