Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Monday, March 26, 2012

Killing mupltiple batches

Is there a SQL command which will kill or exit all batches in the query
analyzer?
For example I have this script:
query1
query2
GO
query3
query4
query5
GO
Is there a way so that when I check @.@.ERROR after query1 that query2,3,4,5
do NOT get executed? GOTO's cannot see beyond the next GO.
Thanks,
Greg
There is no neat way to do this in Query Analyzer except raising an error
with severity 20 or higher, which will terminate your connection:
RAISERROR ('Your message here.', 20, 1)
If you use osql to run a script, you can raise an error with a status of
127, which will have the same effect, but won't leave traces in the SQL
Server error log like raising an error with status 20 does.
RAISERROR ('Your message here.', 16, 127)
Jacco Schalkwijk
SQL Server MVP
"Greg Michalopoulos" <gmichalopoulos@.d2hawkeye.com> wrote in message
news:OYM9dqG5EHA.2600@.TK2MSFTNGP09.phx.gbl...
> Is there a SQL command which will kill or exit all batches in the query
> analyzer?
> For example I have this script:
> query1
> query2
> GO
> query3
> query4
> query5
> GO
> Is there a way so that when I check @.@.ERROR after query1 that query2,3,4,5
> do NOT get executed? GOTO's cannot see beyond the next GO.
> Thanks,
> Greg
>
|||Hello I had a similar problem as original poster - needing to kill multiple
batches within the same script.
Raiserror is not working for me.
raiserror ('just kill me now',19,1, 'WITH LOG,NOWAIT')
comes back with
Server: Msg 2754, Level 16, State 1, Line 1
Error severity levels greater than 18 can only be specified by members of
the sysadmin role, using the WITH LOG option.
I am sure that the account i am using has the sysadmin fixed server role.
PLEASE HELP!
Thanks,
Joel Mariano
"Jacco Schalkwijk" wrote:

> There is no neat way to do this in Query Analyzer except raising an error
> with severity 20 or higher, which will terminate your connection:
> RAISERROR ('Your message here.', 20, 1)
> If you use osql to run a script, you can raise an error with a status of
> 127, which will have the same effect, but won't leave traces in the SQL
> Server error log like raising an error with status 20 does.
> RAISERROR ('Your message here.', 16, 127)
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Greg Michalopoulos" <gmichalopoulos@.d2hawkeye.com> wrote in message
> news:OYM9dqG5EHA.2600@.TK2MSFTNGP09.phx.gbl...
>
>
|||Whoops, brain fart:
raiserror ('just kill me now',20,1) WITH LOG,NOWAIT
works just fine (drops the connection).
"Joel Mariano" wrote:
[vbcol=seagreen]
> Hello I had a similar problem as original poster - needing to kill multiple
> batches within the same script.
> Raiserror is not working for me.
> raiserror ('just kill me now',19,1, 'WITH LOG,NOWAIT')
> comes back with
> Server: Msg 2754, Level 16, State 1, Line 1
> Error severity levels greater than 18 can only be specified by members of
> the sysadmin role, using the WITH LOG option.
> I am sure that the account i am using has the sysadmin fixed server role.
> PLEASE HELP!
> Thanks,
> Joel Mariano
> "Jacco Schalkwijk" wrote:
sql

Friday, March 23, 2012

Kill multiple batches

Is there a SQL command which will kill or exit all batches in the query
analyzer?
For example I have this script:
query1
query2
GO
query3
query4
query5
GO
Is there a way so that when I check @.@.ERROR after query1 that query2,3,4,5
do NOT get executed? GOTO's cannot see beyond the next GO. RETURN just
jumps to right after the next GO as well.
Thanks,
Greg
Greg Michalopoulos wrote:
> Is there a SQL command which will kill or exit all batches in the
> query analyzer?
> For example I have this script:
> query1
> query2
> GO
> query3
> query4
> query5
> GO
> Is there a way so that when I check @.@.ERROR after query1 that
> query2,3,4,5 do NOT get executed? GOTO's cannot see beyond the next
> GO. RETURN just jumps to right after the next GO as well.
> Thanks,
> Greg
I assume you are running this from QA or equivalent? You can use a temp
table to store status if you need to.
David Gugick
Imceda Software
www.imceda.com

Wednesday, March 21, 2012

Kick off procs

Hello. I was wondering what is the best way to kick off multiple procs
trapping the ones that had an error. Here's an example of what I came up
with.
alter procedure dbo.testError
@.problem int = 0 OUTPUT
AS
set nocount on
print 'start'
Declare @.error_msg int
set @.error_msg = 0
set @.error_msg = (Select count(*) from notable)
print 'yo'
select @.error_msg = @.@.error
IF @.error_msg != 0 GOTO handle_error
return @.Problem
handle_error:
set @.Problem = @.error_msg + @.Problem
print @.Problem
-- this is where I would kick off the processes in sequence
declare @.msg int
EXEC @.msg = testError
print 'testing = ' + convert(varchar(20), @.msg)
on testError I have an output variable. when you kick off the proc in my
kick off code, the print line never gets executed. and the subroutine in the
main proc never gets called. Really all I want to do is kick off a list of
sprocs and write to a table wether it was a success or not, then go on
kicking off the next sproc. Also, is it nessecarry to alter all my existing
sprocs to have an output variable and catch @.@.error on all calls to the db,
if not that would be ideal.
just wondering how everyone handles trapping errors with a kick off sproc,
and why this is not working.
Thanks,
RobRobert H wrote:
> Hello. I was wondering what is the best way to kick off multiple procs
> trapping the ones that had an error. Here's an example of what I came
> up with.
> alter procedure dbo.testError
> @.problem int = 0 OUTPUT
> AS
> set nocount on
> print 'start'
> Declare @.error_msg int
> set @.error_msg = 0
> set @.error_msg = (Select count(*) from notable)
> print 'yo'
> select @.error_msg = @.@.error
> IF @.error_msg != 0 GOTO handle_error
>
> return @.Problem
> handle_error:
> set @.Problem = @.error_msg + @.Problem
> print @.Problem
>
> -- this is where I would kick off the processes in sequence
> declare @.msg int
> EXEC @.msg = testError
> print 'testing = ' + convert(varchar(20), @.msg)
>
> on testError I have an output variable. when you kick off the proc in
> my kick off code, the print line never gets executed. and the
> subroutine in the main proc never gets called. Really all I want to
> do is kick off a list of sprocs and write to a table wether it was a
> success or not, then go on kicking off the next sproc. Also, is it
> nessecarry to alter all my existing sprocs to have an output variable
> and catch @.@.error on all calls to the db, if not that would be ideal.
> just wondering how everyone handles trapping errors with a kick off
> sproc, and why this is not working.
> Thanks,
> Rob
You're using a return value and an OUTPUT paramer in some interleaved
fashion, but they are not compatible.
You can return an INT return value using the following exec code and a
return statement:
DECLARE @.iRet INT
EXEC @.iRet = dbo.MyProc
PRINT @.iRet
You can use an OUTPUT parameter of most any data type and access the
value with the following exec code:
DECLARE @.NewName VARCHAR(50)
EXEC dbo.MyProc @.NewName OUTPUT
PRINT @.NewName
Or to do both:
DECLARE @.iRet INT
DECLARE @.NewName VARCHAR(50)
EXEC @.iRet = dbo.MyProc @.NewName OUTPUT
SELECT @.iRet, @.NewName
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi
Your print statement will reset @.@.ERROR therefore it is not going to give
you an error value.
You may want to read
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
John
"Robert H" wrote:

> Hello. I was wondering what is the best way to kick off multiple procs
> trapping the ones that had an error. Here's an example of what I came up
> with.
> alter procedure dbo.testError
> @.problem int = 0 OUTPUT
> AS
> set nocount on
> print 'start'
> Declare @.error_msg int
> set @.error_msg = 0
> set @.error_msg = (Select count(*) from notable)
> print 'yo'
> select @.error_msg = @.@.error
> IF @.error_msg != 0 GOTO handle_error
>
> return @.Problem
> handle_error:
> set @.Problem = @.error_msg + @.Problem
> print @.Problem
>
> -- this is where I would kick off the processes in sequence
> declare @.msg int
> EXEC @.msg = testError
> print 'testing = ' + convert(varchar(20), @.msg)
>
> on testError I have an output variable. when you kick off the proc in my
> kick off code, the print line never gets executed. and the subroutine in t
he
> main proc never gets called. Really all I want to do is kick off a list of
> sprocs and write to a table wether it was a success or not, then go on
> kicking off the next sproc. Also, is it nessecarry to alter all my existin
g
> sprocs to have an output variable and catch @.@.error on all calls to the db
,
> if not that would be ideal.
> just wondering how everyone handles trapping errors with a kick off sproc,
> and why this is not working.
> Thanks,
> Rob
>
>

kick off multiple procs

Hello. I was wondering what is the best way to kick off multiple procs
trapping the ones that had an error. Here's an example of what I came up
with.
alter procedure dbo.testError
@.problem int = 0 OUTPUT
AS
set nocount on
print 'start'
Declare @.error_msg int
set @.error_msg = 0
set @.error_msg = (Select count(*) from notable)
print 'yo'
select @.error_msg = @.@.error
IF @.error_msg != 0 GOTO handle_error
return @.Problem
handle_error:
set @.Problem = @.error_msg + @.Problem
print @.Problem
-- this is where I would kick off the processes in sequence
declare @.msg int
EXEC @.msg = testError
print 'testing = ' + convert(varchar(20), @.msg)
on testError I have an output variable. when you kick off the proc in my
kick off code, the print line never gets executed. and the subroutine in the
main proc never gets called. Really all I want to do is kick off a list of
sprocs and write to a table wether it was a success or not, then go on
kicking off the next sproc. Also, is it nessecarry to alter all my existing
sprocs to have an output variable and catch @.@.error on all calls to the db,
if not that would be ideal.
just wondering how everyone handles trapping errors with a kick off sproc,
and why this is not working.
Thanks,
RobRobert,
Check out:
http://www.sommarskog.se/error-handling-I.html
and
http://www.sommarskog.se/error-handling-II.html
HTH
Jerry
"Robert H" <thestripe@.yahoo_spamno.com> wrote in message
news:u%23p0BJQyFHA.2348@.TK2MSFTNGP15.phx.gbl...
> Hello. I was wondering what is the best way to kick off multiple procs
> trapping the ones that had an error. Here's an example of what I came up
> with.
> alter procedure dbo.testError
> @.problem int = 0 OUTPUT
> AS
> set nocount on
> print 'start'
> Declare @.error_msg int
> set @.error_msg = 0
> set @.error_msg = (Select count(*) from notable)
> print 'yo'
> select @.error_msg = @.@.error
> IF @.error_msg != 0 GOTO handle_error
>
> return @.Problem
> handle_error:
> set @.Problem = @.error_msg + @.Problem
> print @.Problem
>
> -- this is where I would kick off the processes in sequence
> declare @.msg int
> EXEC @.msg = testError
> print 'testing = ' + convert(varchar(20), @.msg)
>
> on testError I have an output variable. when you kick off the proc in my
> kick off code, the print line never gets executed. and the subroutine in
> the
> main proc never gets called. Really all I want to do is kick off a list of
> sprocs and write to a table wether it was a success or not, then go on
> kicking off the next sproc. Also, is it nessecarry to alter all my
> existing
> sprocs to have an output variable and catch @.@.error on all calls to the
> db,
> if not that would be ideal.
> just wondering how everyone handles trapping errors with a kick off sproc,
> and why this is not working.
> Thanks,
> Rob
>
>

Kick off a DTS Package from ASP?

Is it possible to execute a DTS Package from ASP?

For example, if a user went to my website and clicked a button, it'd execute the DTS package? Thanks.This dts needs to kick off from asp or asp.net?

There is a stored procedure in the master db that can do this. I cannot remember the name, but I remember finding it on some SQL Server site. I will try to track it down again.|||Baxicall you have to use DTS.Package object to run those!

See belwo URL that has some code example on how to do it!

http://support.microsoft.com/default.aspx?scid=kb;en-us;252987

http://www.asp101.com/articles/carvin/dts/default.asp

Hope it helps!|||It was ASP.NET, I apologize for not mentioning it. Will the cited examples work in .NET?|||Here is the one related to that
http://support.microsoft.com/default.aspx?scid=kb;en-us;321525

But I haven't tried at (As my old app which I made using ASP)

Monday, March 19, 2012

keyword parameter

Is it possible to have a parameter that uses "LIKE" instead of other
operators? For example:
WHERE company LIKE @.company
instead of:
WHERE company = @.company
any ideas as to other strategies which would accomplish the same thing?
thanks!It should work just like you have listed... assuming the end user will put
the wildcards in the parameter... Otherwise you might do
where company like '%' + @.company + '%'
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"jmann" <jmann@.discussions.microsoft.com> wrote in message
news:10929361-B7D7-4976-BA09-7A1B107B9391@.microsoft.com...
> Is it possible to have a parameter that uses "LIKE" instead of other
> operators? For example:
> WHERE company LIKE @.company
> instead of:
> WHERE company = @.company
> any ideas as to other strategies which would accomplish the same thing?
> thanks!|||It worked! THANK YOU SO MUCH!!!
"Wayne Snyder" wrote:
> It should work just like you have listed... assuming the end user will put
> the wildcards in the parameter... Otherwise you might do
> where company like '%' + @.company + '%'
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "jmann" <jmann@.discussions.microsoft.com> wrote in message
> news:10929361-B7D7-4976-BA09-7A1B107B9391@.microsoft.com...
> > Is it possible to have a parameter that uses "LIKE" instead of other
> > operators? For example:
> >
> > WHERE company LIKE @.company
> >
> > instead of:
> >
> > WHERE company = @.company
> >
> > any ideas as to other strategies which would accomplish the same thing?
> >
> > thanks!
>
>

Keyboard keys used to enter a null into db table field

Hey All,

Once upon a time I knew which keyboard keys were used when entering a null value into a field. For example, say there is a value in a date column and I want to change it back to null. I can't seem to remember what the key combination on the keyboard is..I think it involve the + and a combonation of two others...It's a small detail but now that's it's on the brain I'd like to know what it is again - If you know, please remind me - ThanksIts ctrl+0|||That's great - Thanks.

Monday, March 12, 2012

key to db error code meaning?

on a server running SQL Server 2000 we occasionally get errors. the most
frequent ones in a recent profiler trace, for example, are 208 and 1205.
i've been searching in vain for an explanation of what these mean. i found a
key to severity, but not to the meaning of the errors themselves. can
someone please point me to a guide on the subject?
cheers,
Tim Hansontbh
Open an ERROR.LOG to see what is going on? Deadlocks?
"tbh" <femdev@.newsgroups.nospam> wrote in message
news:OypijxhbIHA.1208@.TK2MSFTNGP03.phx.gbl...
> on a server running SQL Server 2000 we occasionally get errors. the most
> frequent ones in a recent profiler trace, for example, are 208 and 1205.
> i've been searching in vain for an explanation of what these mean. i found
> a key to severity, but not to the meaning of the errors themselves. can
> someone please point me to a guide on the subject?
> cheers,
> Tim Hanson
>|||thanks. i was thinking more in terms of a table of definitions. i can find
hints, e.g., for error 208:
http://www.novicksoftware.com/TipsAndTricks/tip-sql-server-replication-208.htm
thought maybe there is a summary of error message meanings (or range
categories) along the lines of what I found for "severity".
the ones we get appear to be routine. there isn't much in the ERROR.LOGs.
thanks again,
tbh
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eAQscEibIHA.536@.TK2MSFTNGP06.phx.gbl...
> tbh
> Open an ERROR.LOG to see what is going on? Deadlocks?
>
>
> "tbh" <femdev@.newsgroups.nospam> wrote in message
> news:OypijxhbIHA.1208@.TK2MSFTNGP03.phx.gbl...
>> on a server running SQL Server 2000 we occasionally get errors. the most
>> frequent ones in a recent profiler trace, for example, are 208 and 1205.
>> i've been searching in vain for an explanation of what these mean. i
>> found a key to severity, but not to the meaning of the errors themselves.
>> can someone please point me to a guide on the subject?
>> cheers,
>> Tim Hanson
>|||The generic error messages are in master.dbo.sysmessages. E.G.,
Select * From master.dbo.sysmessages Where error = 208
But when you actually get the errors, SQL Server will pass back a string as
well as the error message. This string will have the parameters replaced
with actual values. For example, error 208 is invalid object name, but when
you actually get the message, it will tell you which object name was
invalid. But if whatever connection method you are using is swallowing the
error text and only returning the error number, you can look it up in
sysmessages. You can also search on it in BOL. BOL doesn't have every
error, but it gives additional info about some of them.
Tom
"tbh" <femdev@.newsgroups.nospam> wrote in message
news:%23g3a4iibIHA.4144@.TK2MSFTNGP05.phx.gbl...
> thanks. i was thinking more in terms of a table of definitions. i can find
> hints, e.g., for error 208:
>
> http://www.novicksoftware.com/TipsAndTricks/tip-sql-server-replication-208.htm
> thought maybe there is a summary of error message meanings (or range
> categories) along the lines of what I found for "severity".
> the ones we get appear to be routine. there isn't much in the ERROR.LOGs.
> thanks again,
> tbh
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:eAQscEibIHA.536@.TK2MSFTNGP06.phx.gbl...
>> tbh
>> Open an ERROR.LOG to see what is going on? Deadlocks?
>>
>>
>> "tbh" <femdev@.newsgroups.nospam> wrote in message
>> news:OypijxhbIHA.1208@.TK2MSFTNGP03.phx.gbl...
>> on a server running SQL Server 2000 we occasionally get errors. the most
>> frequent ones in a recent profiler trace, for example, are 208 and 1205.
>> i've been searching in vain for an explanation of what these mean. i
>> found a key to severity, but not to the meaning of the errors
>> themselves. can someone please point me to a guide on the subject?
>> cheers,
>> Tim Hanson
>>
>

Friday, February 24, 2012

Keep sp in cache

hi, I wonder if anyone knows if it is possible to specify that a specific
stored procedure always should stay in cache or for example set that i
specific sp has "high cache priority"?
Regards
Juaninho
No. You can be sneaky about it though and have a default parameter that is
used as a flag to return immediately. Then you can set up a sql agent job
to fire every so often (minutes/hours?) with that flag set, which will keep
the plan in cache. This could lead to poor query plans if the OTHER
parameters for the sproc (if any) are not typical.
TheSQLGuru
President
Indicium Resources, Inc.
"Juaninho" <Juaninho@.discussions.microsoft.com> wrote in message
news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
> hi, I wonder if anyone knows if it is possible to specify that a specific
> stored procedure always should stay in cache or for example set that i
> specific sp has "high cache priority"?
> Regards
> Juaninho
|||On Apr 24, 5:41 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> No. You can be sneaky about it though and have a default parameter that is
> used as a flag to return immediately. Then you can set up a sql agent job
> to fire every so often (minutes/hours?) with that flag set, which will keep
> the plan in cache. This could lead to poor query plans if the OTHER
> parameters for the sproc (if any) are not typical.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "Juaninho" <Juani...@.discussions.microsoft.com> wrote in message
> news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
>
>
> - Show quoted text -
If you are using SQL Server 2005 Look at USE PLAN, KEEPFIXED PLAN in
BOL
Regards
Amish Shah
http://shahamishm.tripod.com

Keep sp in cache

hi, I wonder if anyone knows if it is possible to specify that a specific
stored procedure always should stay in cache or for example set that i
specific sp has "high cache priority"?
Regards
JuaninhoNo. You can be sneaky about it though and have a default parameter that is
used as a flag to return immediately. Then you can set up a sql agent job
to fire every so often (minutes/hours') with that flag set, which will keep
the plan in cache. This could lead to poor query plans if the OTHER
parameters for the sproc (if any) are not typical.
--
TheSQLGuru
President
Indicium Resources, Inc.
"Juaninho" <Juaninho@.discussions.microsoft.com> wrote in message
news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
> hi, I wonder if anyone knows if it is possible to specify that a specific
> stored procedure always should stay in cache or for example set that i
> specific sp has "high cache priority"?
> Regards
> Juaninho|||On Apr 24, 5:41 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> No. You can be sneaky about it though and have a default parameter that is
> used as a flag to return immediately. Then you can set up a sql agent job
> to fire every so often (minutes/hours') with that flag set, which will keep
> the plan in cache. This could lead to poor query plans if the OTHER
> parameters for the sproc (if any) are not typical.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "Juaninho" <Juani...@.discussions.microsoft.com> wrote in message
> news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
>
> > hi, I wonder if anyone knows if it is possible to specify that a specific
> > stored procedure always should stay in cache or for example set that i
> > specific sp has "high cache priority"?
> > Regards
> > Juaninho- Hide quoted text -
> - Show quoted text -
If you are using SQL Server 2005 Look at USE PLAN, KEEPFIXED PLAN in
BOL
Regards
Amish Shah
http://shahamishm.tripod.com

Keep sp in cache

hi, I wonder if anyone knows if it is possible to specify that a specific
stored procedure always should stay in cache or for example set that i
specific sp has "high cache priority"?
Regards
JuaninhoNo. You can be sneaky about it though and have a default parameter that is
used as a flag to return immediately. Then you can set up a sql agent job
to fire every so often (minutes/hours') with that flag set, which will keep
the plan in cache. This could lead to poor query plans if the OTHER
parameters for the sproc (if any) are not typical.
TheSQLGuru
President
Indicium Resources, Inc.
"Juaninho" <Juaninho@.discussions.microsoft.com> wrote in message
news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
> hi, I wonder if anyone knows if it is possible to specify that a specific
> stored procedure always should stay in cache or for example set that i
> specific sp has "high cache priority"?
> Regards
> Juaninho|||On Apr 24, 2:00 am, Juaninho <Juani...@.discussions.microsoft.com>
wrote:
> hi, I wonder if anyone knows if it is possible to specify that a specific
> stored procedure always should stay in cache or for example set that i
> specific sp has "high cache priority"?
> Regards
> Juaninho
If you've not read the BOL yet, here is what it says. After attending
Kalen Delaney's presentation last week I was reading about it more. I
have not seen any way or technique to keep the stored proc in the
cache. What I understand is even the execution plan is eligible for
deallocation sql server does not deallocate it till the resources is
needed. But make sure you have a lot of memory and that sql server
can use all of it.
After an execution plan is generated, it stays in the procedure cache.
SQL Server 2000 ages old, unused plans out of the cache only when
space is needed. Each query plan and execution context has an
associated cost factor that indicates how expensive the structure is
to compile. These data structures also have an age field. Each time
the object is referenced by a connection, the age field is incremented
by the compilation cost factor. For example, if a query plan has a
cost factor of 8 and is referenced twice, its age becomes 16. The
lazywriter process periodically scans the list of objects in the
procedure cache. The lazywriter decrements the age field of each
object by 1 on each scan. The age of our sample query plan is
decremented to 0 after 16 scans of the procedure cache, unless another
user references the plan. The lazywriter process deallocates an object
if these conditions are met:
The memory manager requires memory and all available memory is
currently in use.
The age field for the object is 0.
The object is not currently referenced by a connection.
Because the age field is incremented each time an object is
referenced, frequently referenced objects do not have their age fields
decremented to 0 and are not aged from the cache. Objects infrequently
referenced are soon eligible for deallocation, but are not actually
deallocated unless memory is required for other objects.
Good day,
Bulent|||On Apr 24, 5:41 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> No. You can be sneaky about it though and have a default parameter that i
s
> used as a flag to return immediately. Then you can set up a sql agent job
> to fire every so often (minutes/hours') with that flag set, which will ke
ep
> the plan in cache. This could lead to poor query plans if the OTHER
> parameters for the sproc (if any) are not typical.
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
> "Juaninho" <Juani...@.discussions.microsoft.com> wrote in message
> news:29BC33AD-8DC2-462A-89F0-B984366895B7@.microsoft.com...
>
>
>
> - Show quoted text -
If you are using SQL Server 2005 Look at USE PLAN, KEEPFIXED PLAN in
BOL
Regards
Amish Shah
http://shahamishm.tripod.com