Re: stored procedure takes too much time to execute
- From: "nicholas" <murmurait1@xxxxxxxxxxx>
- Date: Wed, 3 Aug 2005 09:23:13 +0200
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("productID"),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
> >
> >
> >
.
- Follow-Ups:
- Re: stored procedure takes too much time to execute
- From: John.Net
- Re: stored procedure takes too much time to execute
- References:
- stored procedure takes too much time to execute
- From: nicholas
- Re: stored procedure takes too much time to execute
- From: Hans Kesting
- Re: stored procedure takes too much time to execute
- From: nicholas
- Re: stored procedure takes too much time to execute
- From: Phillip Ian
- Re: stored procedure takes too much time to execute
- From: nicholas
- Re: stored procedure takes too much time to execute
- From: HARI PRASD BARU
- stored procedure takes too much time to execute
- Prev by Date: RE: Graphic in Calendar
- Next by Date: Metasearch in dotnet?
- Previous by thread: Re: stored procedure takes too much time to execute
- Next by thread: Re: stored procedure takes too much time to execute
- Index(es):
Relevant Pages
|