It is my understanding that in SQL2000, stored procedure are no longer
compiled. If that is true is there really any performance advantage to
using sp's for .Net datasets or datareaders?

--
Barry Fitzgerald

Re: Performance by Miha

Miha
Wed Jan 07 16:05:26 CST 2004

HI Barry,

Err, what?
I think they are still very much compiled :)
Anyway, even if they weren't there are many advantages using them (you can
limit access to database by granting users access only to sps instead
directly to tables, etc).

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Barry" <barryfz@home.com> wrote in message
news:eI0tyjW1DHA.2480@TK2MSFTNGP10.phx.gbl...
> It is my understanding that in SQL2000, stored procedure are no longer
> compiled. If that is true is there really any performance advantage to
> using sp's for .Net datasets or datareaders?
>
> --
> Barry Fitzgerald
>
>



Re: Performance by v-kevy

v-kevy
Wed Jan 07 20:42:37 CST 2004

Thanks for Miha's response.

Hi Barry,

The stored procedure is compiled in SQL Server 2000.

When a stored procedure is first executed, the source is compiled into an
execution plan. If the stored procedure is again executed before the
execution plan is aged from memory, the relational engine detects the
existing plan and reuses it. If the plan has aged out of memory, a new plan
is built.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_
ar_sa_7cmm.asp

As a database is changed by such actions as adding indexes or changing data
in indexed columns, the original query plans used to access its tables
should be optimized again by recompiling them.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm
_8_des_07_6cmd.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Performance by Barry

Barry
Thu Jan 08 09:07:34 CST 2004

In Visual Studio Magazine, Jan 2004, Write .NET CXCoe in SQL Server by Bob
Beauchemin of Developmentor, he states:

"...Since SQL Server 7, stored procdures and user defined functions (UDFs)
aren't precompile or stored in an intermediat parsed-tree format prior to
use, as in earlier version."

That is where I got the idea they are no longer compiled. I will try to
contact him to understand this better.

--
Barry Fitzgerald
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:b%23dfYEZ1DHA.3532@cpmsftngxa07.phx.gbl...
> Thanks for Miha's response.
>
> Hi Barry,
>
> The stored procedure is compiled in SQL Server 2000.
>
> When a stored procedure is first executed, the source is compiled into an
> execution plan. If the stored procedure is again executed before the
> execution plan is aged from memory, the relational engine detects the
> existing plan and reuses it. If the plan has aged out of memory, a new
plan
> is built.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_
> ar_sa_7cmm.asp
>
> As a database is changed by such actions as adding indexes or changing
data
> in indexed columns, the original query plans used to access its tables
> should be optimized again by recompiling them.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm
> _8_des_07_6cmd.asp
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



Re: Performance by Barry

Barry
Thu Jan 08 09:13:30 CST 2004

Also the links you provided got to Page Cannot Be Found on the msdn site????

--
Barry Fitzgerald
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:b%23dfYEZ1DHA.3532@cpmsftngxa07.phx.gbl...
> Thanks for Miha's response.
>
> Hi Barry,
>
> The stored procedure is compiled in SQL Server 2000.
>
> When a stored procedure is first executed, the source is compiled into an
> execution plan. If the stored procedure is again executed before the
> execution plan is aged from memory, the relational engine detects the
> existing plan and reuses it. If the plan has aged out of memory, a new
plan
> is built.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_
> ar_sa_7cmm.asp
>
> As a database is changed by such actions as adding indexes or changing
data
> in indexed columns, the original query plans used to access its tables
> should be optimized again by recompiling them.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm
> _8_des_07_6cmd.asp
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



Re: Performance by v-kevy

v-kevy
Fri Jan 09 01:30:45 CST 2004

Hi Barry,

Please notice the word wrap. There are 2 lines for each link. Please
conbine the 2 links for the complete link.

The article says that the stored precedures are not precompile which means
they are not compiled before first use. After first use, there will be a
compiled version stored in the database.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Performance by Barry

Barry
Fri Jan 09 10:19:44 CST 2004

Thanks Kevin, that clarifes things.


--
Barry Fitzgerald


"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:5ewmHKo1DHA.3532@cpmsftngxa07.phx.gbl...
> Hi Barry,
>
> Please notice the word wrap. There are 2 lines for each link. Please
> conbine the 2 links for the complete link.
>
> The article says that the stored precedures are not precompile which means
> they are not compiled before first use. After first use, there will be a
> compiled version stored in the database.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>