select USER_NAME() : USER_NAME « System « SQL Server / T-SQL






select USER_NAME()

 

4> SELECT GETDATE(), USER_NAME(), SUSER_SNAME(),
5> USER_NAME(), USER_NAME()
6> GO



----------------------- -------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------
--------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------
---------- --------------------------------------------------------------------------------------------------------------------------------
2008-08-17 13:20:57.703 dbo                                                                                                                              J\Administrator
                                                                                  dbo
           dbo

(1 rows affected)
1>

 








Related examples in the same category