October 11, 2005 at 3:09 am
Does anyone know what command I can use in my query to pull an enviroment variable (I created) into my database?
Thanks for any suggestions.
October 11, 2005 at 3:52 am
You can use xp_cmdshell for all kinds of interaction with the shell. Using something like EXEC master.dbo.xp_cmdshell 'echo %FOO%' you can get the value of an environment variable called foo. You will need to pick it up in some way, for instance by inserting the result set returned into a temp table.
Note that the environment variable must be available from the context of the account SQL Server is running as.
October 11, 2005 at 3:55 am
Thanks Chris
I'll take a look at that.
Ricky
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply