You are seeing the last command run by the session.
sp_unprepare remove the item used by sp_prepare. This is how most drivers run TSQL code with parameters, like JDBC. This is very common and not a cause for concern.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hello,
when i run sp_who /sp_whoisactive procs, i see statements like "EXEC sp_unprepare 124" run by some sessions. When i reached out to my development team they dont seem to be using these stored procedures. So is there any particular driver like jdbc internally creates it and sends it to sql server? if yes can someone give me example
You are seeing the last command run by the session.
sp_unprepare remove the item used by sp_prepare. This is how most drivers run TSQL code with parameters, like JDBC. This is very common and not a cause for concern.
Thanks Tom, so if i understand this clearly . a client code like "select * from <table> where <column>=5" will be translated using sp_prepare as dynamic sql and transferred to sql server in form of sp_prepare?
if yes which statement will use sp_prepare/sp_unprepare? i have also seen simple SELECT statements without any sp_prepare . so want to know difference between these two.