SQL Server: SYSTEM_USER Function

SYSTEM_USER function in SQL Servers

This SQL Server tutorial explains how to use the SYSTEM_USER function in SQL Servers (Transact-SQL) with syntax and examples.

Description

In SQL Server (Transact-SQL), the SYSTEM_USER functions returns the login name information for the current user in the SQL Server database.

Syntax

The syntax for the SYSTEM_USER function in SQL Server (Transact-SQL) is:

SYSTEM_USER

Parameters or Arguments

There are no parameters or arguments for the SYSTEM_USER function.

Note

  • If the current user is logged into SQL Server using Windows Authentication, the SYSTEM_USER function will return the login name information in the following format: DOMAIN\user_name
  • If the current user is logged into SQL Server using SQL Server Authenication, the SYSTEM_USER function will return the login name information in the following format: user_name
  • Do not put parentheses () after the SYSTEM_USER function.
  • See also the CURRENT_USERUSER_NAME, and SESSION_USER functions.

Applies To

The SYSTEM_USER function can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

Example

Let’s look at some SQL Server SYSTEM_USER function examples and explore how to use the SYSTEM_USER function in SQL Server (Transact-SQL).

For example:

SELECT SYSTEM_USER;
Result: 'test_domain\jsmith'   (logged in using Windows Authentication)

SELECT SYSTEM_USER;
Result: 'jsmith'               (logged in using SQL Server Authentication)

This Post Has 103 Comments

  1. MP3Juices

    Nice post. I learn something new and challenging on sites I stumbleupon everyday. It’s always helpful to read articles from other writers and practice a little something from other web sites.

  2. Snaptik.vin

    Aw, this was an extremely good post. Finding the time and actual effort to produce a very good article… but what can I say… I put things off a whole lot and never seem to get anything done.

  3. Avanda Alvin

    Great blog you’ve got here.. It’s difficult to find good quality writing like yours these days. I honestly appreciate people like you! Take care!!

  4. 한국야동

    I really enjoy the article post.Really looking forward to read more. Want more.

  5. PG SLOT

    Very neat article.Really looking forward to read more. Really Cool.

  6. fakaza

    Nice post. I learn something totally new and challenging on sites I stumbleupon every day. It will always be helpful to read articles from other writers and use a little something from their sites.

  7. auto lift near me

    The very next time I read a blog, Hopefully it won’t fail me as much as this one. I mean, Yes, it was my choice to read through, but I actually believed you would probably have something interesting to say. All I hear is a bunch of crying about something that you can fix if you weren’t too busy seeking attention.

  8. porn

    Aw, this was an incredibly good post. Finding the time and actual effort to generate a great article… but what can I say… I put things off a lot and never seem to get nearly anything done.

  9. Learn More Here

    I am so grateful for your article.Much thanks again. Will read on…

  10. Jobs in katsina

    Im obliged for the article post.Really looking forward to read more. Much obliged.

  11. hop over to here

    You have made some decent points there. I looked on the web to find out more about the issue and found most people will go along with your views on this site.

  12. car detailing

    I appreciate you sharing this article post.Much thanks again.

  13. There is definately a great deal to know about this subject. I like all of the points you made.

  14. supermario

    I cannot thank you enough for the article post. Awesome.

  15. Mp3

    Oh my goodness! Awesome article dude! Thank you so much, However I am having problems with your RSS. I don’t understand the reason why I am unable to subscribe to it. Is there anybody having similar RSS problems? Anybody who knows the solution will you kindly respond? Thanx.

  16. whoah this weblog is excellent i like studying your posts.
    Stay up the great work! You recognize, a lot of individuals are searching
    round for this information, you could help them greatly.

    Also visit my webpage :: секс порно чат

  17. fakaza mp3

    I blog frequently and I seriously thank you for your content. This great article has really peaked my interest. I’m going to book mark your blog and keep checking for new details about once per week. I subscribed to your RSS feed too.

  18. I seriously love your site.. Excellent colors & theme. Did you create this site yourself? Please reply back as I’m trying to create my very own website and want to learn where you got this from or just what the theme is called. Thank you.

  19. live4d2u

    I cannot thank you enough for the blog post.Really looking forward to read more.

  20. visite site

    Thanks for sharing, this is a fantastic article post.Really looking forward to read more. Really Cool.

  21. pavers livermore

    Thank you ever so for you article post.Really looking forward to read more. Cool.

  22. A fascinating discussion is definitely worth comment. I believe that you ought to write more about this topic, it might not be a taboo subject but generally people do not discuss these topics. To the next! Many thanks.

  23. Im grateful for the blog post.Really looking forward to read more. Really Great.

  24. pavers livermore

    I think this is a real great post.Really looking forward to read more. Really Great.

  25. Really enjoyed this blog article.Really looking forward to read more. Keep writing.

  26. view it

    wow, awesome post.Really thank you! Want more.

  27. GBP

    Looking forward to reading more. Great article post.Really thank you! Awesome.

  28. mp3quack

    That is a good tip particularly to those new to the blogosphere. Brief but very precise information… Thanks for sharing this one. A must read article!

  29. Way cool! Some extremely valid points! I appreciate you writing this article and also the rest of the website is extremely good.

  30. local news

    Hi there, You have done an incredible job. I?ll definitely digg it and personally suggest to my friends. I am confident they’ll be benefited from this website.

  31. Oh my goodness! Impressive article dude! Thank you so much, However I am encountering difficulties with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anyone else having the same RSS issues? Anyone who knows the answer will you kindly respond? Thanks!

  32. Everything is very open with a precise description of the challenges. It was truly informative. Your site is very useful. Thank you for sharing!

  33. mp3juices

    Very good information. Lucky me I discovered your blog by chance (stumbleupon). I’ve book marked it for later.

  34. mp3

    Aw, this was an exceptionally good post. Spending some time and actual effort to produce a great article… but what can I say… I put things off a whole lot and never seem to get nearly anything done.

  35. Nice post. I learn something new and challenging on blogs I stumbleupon everyday. It’s always useful to read articles from other writers and practice a little something from their websites.

  36. Tubidy

    Thanks for sharing, this is a fantastic blog. Fantastic.

  37. Tubidy

    You are so awesome! I do not believe I have read through something like this before. So nice to discover another person with original thoughts on this subject. Seriously.. many thanks for starting this up. This site is something that’s needed on the web, someone with a bit of originality.

  38. I wanted to thank you for this great read!! I absolutely enjoyed every bit of it. I have got you bookmarked to check out new things you postÖ

  39. read more

    Hello there! I simply wish to offer you a big thumbs up for your excellent information you have right here on this post. I will be returning to your web site for more soon.

  40. Having read this I believed it was rather enlightening. I appreciate you taking the time and effort to put this short article together. I once again find myself personally spending a significant amount of time both reading and posting comments. But so what, it was still worthwhile!

  41. learn more

    Major thankies for the blog.Really looking forward to read more.

  42. vacuum pump penis

    Looking forward to reading more. Great blog.Much thanks again. Will read on…

Leave a Reply

WC Captcha 56 + = 60