473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

sp_executesql question

I have not used this sp. We have a dynamic SQL statement generated by a sp.
For performance reasons I would like to use it to reduce the number of
explain plans created. I would like to understand its usage and pitfalls
(if any) to its use. Any comments from the user community?
Feb 13 '06 #1
2 1098
Robert (ro***********@boeing.com) writes:
I have not used this sp. We have a dynamic SQL statement generated by a
sp. For performance reasons I would like to use it to reduce the number
of explain plans created. I would like to understand its usage and
pitfalls (if any) to its use. Any comments from the user community?


Explain plans? Isn't that an Oracle term? :-)

Anyway, I have this article on my web site about dynamic SQL:
http://www.sommarskog.se/dynamic_sql.html.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 13 '06 #2
Thanx Erland. I guess you are correct. In SQL Server it is refered to as
an execution plan. Thanx for the link. I am looking forward to reviewing
it. It is obvious you have put a lot of time and energy in the write-up.
Merci et au revoir.
"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn*******************@127.0.0.1...
Robert (ro***********@boeing.com) writes:
I have not used this sp. We have a dynamic SQL statement generated by a
sp. For performance reasons I would like to use it to reduce the number
of explain plans created. I would like to understand its usage and
pitfalls (if any) to its use. Any comments from the user community?


Explain plans? Isn't that an Oracle term? :-)

Anyway, I have this article on my web site about dynamic SQL:
http://www.sommarskog.se/dynamic_sql.html.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cliverama | last post by:
help! fried brains.... asp calling a sqlserver7 stored proc which dynamically builds a sqlstatement & passes it to sp_executesql asp page gives the operation not allowed when object is closed...
1
by: Justin Wong | last post by:
CREATE PROCEDURE dbo.Synchronization_GetNewRecords ( @item varchar(50), @last datetime ) AS SET NOCOUNT ON
1
by: DBA | last post by:
Does anyone know the technical reason for why sp_executesql uses the N prefix before the string that is passed? For example: sp_executesql N'USE Northwind' Thanks!
3
by: thomson | last post by:
Hi all, Can sp_executesql used inside a user defined function, i tried but it has compiled well, but when i call the functio it shows Only functions and extended stored procedures can be executed...
1
by: LineVoltageHalogen | last post by:
Greetings All, currentley there is a heated discussion in my place of work over which method is better/more efficient for simple selects. Background: 1.) Simple Application that uses sql server...
7
by: LineVoltageHalogen | last post by:
Greetings All, I have a very large query that uses dynamic sql. The sql is very large and it requires it to be broken into three components to avoid the nvarchar(4000) issue: SET @v_SqlString(...
3
by: elRoyFlynn | last post by:
This is a odd problem where a bad plan was chosen again and again, but then not. Using the profiler, I identified an application-issued statement that performed poorly. It took this form: ...
1
by: Matik | last post by:
Hi to all, Probably I'm just doing something stupid, but I would like you to tell me that (if it is so), and point the solution. There ist the thing: I' having a sp, where I call other sp...
1
by: satishchandrat | last post by:
Hi, This is regarding the sp_executesql and the sql statement parameter, in processing a dynamic SQL on SQL Server 2000, in my stored procedure. I have my SQL string exeeding more than 4000...
5
by: Yash | last post by:
Hi, I am using SQL 2000 SP4. I have compared 2 scenarios: Scenario 1: insert into #bacs_report SELECT ..... WHERE <conditions>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.