Answers

Question and Answer:

  Home  MS SQL Server

⟩ How To Verify a User name with SQLCMD Tool?

The quickest way to verify a user name in a database is probably to use the SQLCMD tool. You can connect to the server, select the database, and check which user name is linked the current login name as shown below.

Start a command window and enter the following command:

C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_Login -P IYF

1> USE GlobalGuideLineDatabase;

2> GO

Changed database context to 'GlobalGuideLineDatabase'.

1> PRINT User_Name();

2> GO

ggl_User

This shows user "ggl_User" in database "GlobalGuideLineDatabase" is linked to login name "ggl_Login".

 162 views

More Questions for you: