How to retrieve the Id session number of the executed query ?
-
Thursday, March 01, 2012 3:56 PM
Hello,
in PDO_SQLDRV i'd like to retrieve the Id session number of a query when I use $pdo->query($StringQuery)
Thanks for your help.
All Replies
-
Thursday, March 01, 2012 4:58 PMModerator
Bruno-
I'm not sure I understand your question. Are you looking for the PDO::lastInsertId method? If not, can you elaborate on what you are trying to do?
Thanks.
-Brian
This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/brian_swan
- Proposed As Answer by Jonathan GuerinMicrosoft Employee Monday, March 05, 2012 8:08 PM
- Unproposed As Answer by Jonathan GuerinMicrosoft Employee Tuesday, March 06, 2012 10:10 PM
-
Tuesday, March 06, 2012 3:11 PM
If you want your SQL Server session ID (from your connection) you can run this query from your PDO connection:
SELECT @@SPID
Rob
- Proposed As Answer by Jonathan GuerinMicrosoft Employee Tuesday, March 06, 2012 10:10 PM
- Marked As Answer by Jonathan GuerinMicrosoft Employee Wednesday, March 07, 2012 8:36 PM

