sql-cli icon indicating copy to clipboard operation
sql-cli copied to clipboard

[Question] How can I investigate server properties?

Open VincentTam opened this issue 5 years ago • 1 comments

Thanks for your package, which I found at the tutorial https://www.freecodecamp.org/news/cjn-how-to-connect-your-microsoft-sql-server-docker-container-with-azure-data-studio/.

How can I execute the following statement found at https://docs.microsoft.com/fr-fr/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash ?

SELECT @@SERVERNAME,
    SERVERPROPERTY('ComputerNamePhysicalNetBIOS'),
    SERVERPROPERTY('MachineName'),
    SERVERPROPERTY('ServerName')

I tried putting this at one line

SELECT @@SERVERNAME, SERVERPROPERTY('ComputerNamePhysicalNetBIOS')

but I got

Error: Incorrect syntax near the keyword 'SELECT'.

VincentTam avatar Nov 29 '20 23:11 VincentTam

If select statements against tables are working then it's possible the underlying library being used does not support reading server variables.

hasankhan avatar Dec 03 '20 13:12 hasankhan