I tried using EXEC sp_who2;
to find the server's domain name, but it gives host, users, etc.
I need to know my SQL Server's domain name, so I can install a plugin to the SQL Server Management Studio.
select right(email_address, length(email_address)-INSTR(email_address, '@')) ... so you don't have to guess how many sub-domains your user's email domain has. Show activity on this post. Brillant answer!
A domain is essentially a data type with optional constraints (restrictions on the allowed set of values). The user who defines a domain becomes its owner. Domains are useful for abstracting common constraints on fields into a single location for maintenance.
In T-SQL, you would use this to query the Domain Name of the SQL Server:
SELECT DEFAULT_DOMAIN()[DomainName]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With