Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Reset sp_prepexec Expand / Collapse
Posted Tuesday, April 29, 2014 2:13 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, November 24, 2016 10:31 PM
Points: 368, Visits: 1,267
Can we reset sp_prepexec and sp_execute
When i am running the sp_prepexec the id is generated say it is 22 then i used sp_execute 22 to execute the statement.
now can i reseed the statement sp_prepexec to start from initial?
sp_prepexec will it start from 1 and can i use sp_execute 1?
Post #1565791
Posted Thursday, May 1, 2014 5:23 AM



Group: General Forum Members
Last Login: Wednesday, February 10, 2016 11:50 AM
Points: 6,897, Visits: 13,559
There is no "initial" value. See this link for a syntax description.
The handle is a system generated int value to uniquely identify the statement. The handle is not

You can (and should!) use sp_unprepare to free memory if the prepared statement is no longer in use. This may (or may not) lead to a lower number returned as the next handle. The handle value is not bound to a single statment.

Based on your description I'm guessing you're planning to "misuse" a handle id for process or loop control. If that's the case then there might be something wrong with your concept in general...

A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #1566672
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse