Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Temp directory

Author  Topic 

geossl
Yak Posting Veteran

85 Posts

Posted - 2004-04-28 : 22:21:44
Dear All,
Is there any way to get the Temp directory in a Stored procedure?

Thanks.

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-04-29 : 00:01:36
????

Do you mean you want to return the results of a windows directory in a stored procedure? What do you mean by "Temp directory"?

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

cas_o
Posting Yak Master

154 Posts

Posted - 2004-04-29 : 06:06:02
create table #out (s varchar(255))
insert into #out(s) exec master..xp_cmdshell 'set'

select right(s,len(s)- 5) TempDir from #out where left(s,4)='TEMP'

drop table #out

will get you the temp directory for the account that SQL server is running under.

;-]... Quack Waddle
Go to Top of Page
   

- Advertisement -