Click here to Skip to main content
15,892,927 members
Home / Discussions / Database
   

Database

 
GeneralRe: Select statement Pin
Krish - KP26-Dec-07 17:21
Krish - KP26-Dec-07 17:21 
AnswerRe: Select statement Pin
tellytub26-Dec-07 21:08
tellytub26-Dec-07 21:08 
Generaldoing function of search Pin
shufun26-Dec-07 14:29
shufun26-Dec-07 14:29 
GeneralI'm sure it is just a minor syntax error... Pin
Andy_L_J26-Dec-07 12:23
Andy_L_J26-Dec-07 12:23 
GeneralRe: I'm sure it is just a minor syntax error... Pin
J$26-Dec-07 13:08
J$26-Dec-07 13:08 
GeneralRe: I'm sure it is just a minor syntax error... Pin
Krish - KP26-Dec-07 17:11
Krish - KP26-Dec-07 17:11 
AnswerRe: I'm sure it is just a minor syntax error... Pin
Andy_L_J26-Dec-07 18:15
Andy_L_J26-Dec-07 18:15 
QuestionUsing avg function for new constructed column? Pin
omegazafer26-Dec-07 9:50
omegazafer26-Dec-07 9:50 
AnswerRe: Using avg function for new constructed column? Pin
Paul Conrad26-Dec-07 12:11
professionalPaul Conrad26-Dec-07 12:11 
AnswerRe: Using avg function for new constructed column? Pin
andyharman26-Dec-07 23:40
professionalandyharman26-Dec-07 23:40 
QuestionHow to encrypt? Pin
Rock Star.25-Dec-07 23:08
Rock Star.25-Dec-07 23:08 
AnswerRe: How to encrypt? Pin
Ujjaval Modi25-Dec-07 23:35
Ujjaval Modi25-Dec-07 23:35 
GeneralRe: How to encrypt? Pin
Rock Star.26-Dec-07 0:12
Rock Star.26-Dec-07 0:12 
AnswerRe: How to encrypt? Pin
Paul Conrad26-Dec-07 12:12
professionalPaul Conrad26-Dec-07 12:12 
Generalsql server 2000 stored procedure Pin
Sonia Gupta25-Dec-07 21:17
Sonia Gupta25-Dec-07 21:17 
GeneralRe: sql server 2000 stored procedure Pin
vimal_yet25-Dec-07 22:30
vimal_yet25-Dec-07 22:30 
GeneralRe: sql server 2000 stored procedure Pin
N a v a n e e t h25-Dec-07 23:15
N a v a n e e t h25-Dec-07 23:15 
AnswerRe: sql server 2000 stored procedure Pin
John-ph26-Dec-07 18:34
John-ph26-Dec-07 18:34 
GeneralRe: sql server 2000 stored procedure Pin
N a v a n e e t h26-Dec-07 18:57
N a v a n e e t h26-Dec-07 18:57 
GeneralRe: sql server 2000 stored procedure Pin
John-ph26-Dec-07 19:27
John-ph26-Dec-07 19:27 
GeneralRe: sql server 2000 stored procedure Pin
N a v a n e e t h26-Dec-07 19:37
N a v a n e e t h26-Dec-07 19:37 
GeneralRe: sql server 2000 stored procedure Pin
John-ph26-Dec-07 20:14
John-ph26-Dec-07 20:14 
GeneralRe: sql server 2000 stored procedure Pin
Mike Dimmick31-Dec-07 0:57
Mike Dimmick31-Dec-07 0:57 
As Navaneeth says, SQL Server stored procedures are optimised no differently from other, ad-hoc queries. However, the resulting query plan is given more weight so it is more likely still to be in the cache when the procedure is next executed.

You must be a bit careful that you do not have massively divergent behaviour depending on different values for parameters. The reason for this is that SQL Server will use the previously compiled query plan regardless of the parameters supplied. If a query plan works well for some values of some parameters but not for others - perhaps an index which is very selective for some values but not for others, such as where a column mostly contains the same value but has a few exceptions - you can get better performance by asking SQL Server to recompile the query. Use WITH RECOMPILE with the EXEC statement to do this on a one-off basis, or specify WITH RECOMPILE in the CREATE PROCEDURE/ALTER PROCEDURE statement to force the plan to be recompiled every time.


DoEvents: Generating unexpected recursion since 1991

GeneralIdentity in a field Pin
M. J. Jaya Chitra25-Dec-07 17:03
M. J. Jaya Chitra25-Dec-07 17:03 
GeneralRe: Identity in a field Pin
KANGAROO_25-Dec-07 18:06
KANGAROO_25-Dec-07 18:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.