---
title: "Write a SQL command to View the session ID of current user process?"  
description: "Write a SQL command to View the session ID of current user process?"  
author: "Ashutosh Kumar Verma"  
published: 2021-11-10  
canonical: https://www.mindstick.com/interview/33811/write-a-sql-command-to-view-the-session-id-of-current-user-process  
category: "mssql server"  
tags: ["sql server", "sql"]  
reading_time: 1 minute  

---

# Write a SQL command to View the session ID of current user process?

\

## Answers

### Answer by Steilla Mitchel

## SQL command to find the Session ID:

The '@@SPID' is used to find the Session ID of users. Following SQL command is used to find the Session ID of current user in SQL Server,

![Write a SQL command to View the session ID of current user process?](https://www.mindstick.com/interviewquestion/202487ba-33c4-4369-8bfc-f57ea2a886fe/images/8df3984a-d10f-480a-ac4a-41e5ee229634.png)

![Write a SQL command to View the session ID of current user process?](https://www.mindstick.com/interviewquestion/202487ba-33c4-4369-8bfc-f57ea2a886fe/images/8241a362-59f2-4e2c-a1ea-bbb150348c95.png)\

### Answer by Ashutosh Kumar Verma

\


---

Original Source: https://www.mindstick.com/interview/33811/write-a-sql-command-to-view-the-session-id-of-current-user-process

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
