Selasa, 05 Oktober 2010
Read Environment Variables in T-SQL
I had recently posted on Use xp_cmdshell results in T_SQL. One of the blog readers Andrew got back asking if it was possible to read Environment Variables using this method and store the value in a variable for later use. Here’s the query. The variable @windir holds the value and you can use it as you want: (Thanks to my colleague Karthi for simplying the query further)DECLARE @windir nvarchar(
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar