I would like to know whether the following 2 options are exactly the same or does one offer any additional "features":
sqlcmd -S <servername> -U <username> -P <password>
runas /user:<username> /noprofile sqlcmd
I usually use the first one to connect to sqlcmd mode from cmd, but I am not sure whether the second one is just a variant or should be used in specific cases, such as if you are connecting using a Windows domain account only while the first option can be used for both SQL and Windows authentication
If SQL User is defined as Domain User in Sql Server you cannot be able to use first method to connect to MS SQL instance.
However second method first authenticates you with your domain credentials then executes sqlcmd with authenticated user (domain user).
to sum up, second method uses Windows Authentication
whereas first method uses SQL Server Authentication