dbTalk Databases Forums  

Sprocs v. embedded queries

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Sprocs v. embedded queries in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Siegfried Heintze
 
Posts: n/a

Default Sprocs v. embedded queries - 04-14-2008 , 02:08 PM






I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried

Reply With Quote
  #2  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM






Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #3  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #4  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #5  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #6  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #7  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #8  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #9  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
  #10  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Sprocs v. embedded queries - 04-16-2008 , 12:17 AM



Depending on how the dynamic queries are done they may or may not have
reusable plans. If they are using sp_executesql instead of exec() and use
the parameters properly they can be reused. Have a look at this:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Siegfried Heintze" <SiegfriedHeintze (AT) discussions (DOT) microsoft.com> wrote in
message news:FA7E8CB7-D41A-45BC-8A25-D7A286B0B1A9 (AT) microsoft (DOT) com...
Quote:
I've read that the advantages of sprocs over embedded queries is that the
former are compiled once.

Does one loose the advantages of stored procedures when one concatentates
a
lot of strings together and then uses the EXEC function to execute the
subsequent query? I'm seeing a lot of this in the stored procedures I'm
debugging.

Thanks,
Siegfried


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.