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 Login name with SQLCMD Tool?
Submitted by: AdministratorThe quickest way to verify a login name on a SQL Server is probably to use the SQLCMD tool, which takes the server name, login name and password in a single command line. Here is how to try it yourself:
Start a command window and enter the following command:
C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_DBA -P ABD_LGG
1> PRINT Suser_Sname();
2> GO
ggl_DBA
1> QUIT
C:>
This shows ggl_DBA is a valid login and the password is correct. Now try this command:
C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_DEV -P ABD_LGG
Msg 18456, Level 14, State 1, Server LOCALHOSTSQLEXPRESS, Line 1
Login failed for user 'ggl_DEV'.
C:>
This shows ggl_DEV is not a valid login or the password is incorrect.
Submitted by: Administrator
Start a command window and enter the following command:
C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_DBA -P ABD_LGG
1> PRINT Suser_Sname();
2> GO
ggl_DBA
1> QUIT
C:>
This shows ggl_DBA is a valid login and the password is correct. Now try this command:
C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_DEV -P ABD_LGG
Msg 18456, Level 14, State 1, Server LOCALHOSTSQLEXPRESS, Line 1
Login failed for user 'ggl_DEV'.
C:>
This shows ggl_DEV is not a valid login or the password is incorrect.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.