How To Verify a User name with SQLCMD Tool?
Submitted by: AdministratorThe 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".
Submitted by: Administrator
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".
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How to download Microsoft SQL Server 2005 Express Edition? |
☺ | What Are Binary String Data Types in MS SQL Server? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | PHP MSSQL - How To Display a Past Time in Days, Hours and Minutes? |
☺ | How To Convert a Numeric Expression from One Data Type to Another? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |