跳至主要內容

获取当前用户的内部标识sql代码

五六零网校小于 1 分钟

代码示例

Select Top 1 b.[UserCode],c.[INTERNAL_K] 
From [master].[dbo].[sysprocesses] As a 
Inner Join [dbo].[USR5] As b On a.[spid]=b.[SessionID] And a.[hostprocess]=b.[ProcessID] 
Inner Join [dbo].[OUSR] As c On b.[UserCode]=c.[USER_CODE]
Where a.[spid]=@@spid And b.[Action]='I'
Order By b.[Date] Desc

显示图例

显示图例
显示图例