Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.