How to Read Environment Variables in SQL Server Using T-SQL
To read Environment variables in T-SQL, you can use the xp_cmdshell extended stored procedure in SQL Server. The following example shows how to read the %windir% environment variable, which gives