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 2005 Forums
 Transact-SQL (2005)
 drive verification

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2008-06-19 : 04:48:50
How is it possible to use sql to verify F: drive is on disk 0 ?
Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-19 : 05:06:01
Use WMI providers.


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2008-06-19 : 05:19:08
Oh...how do you do that at all?? Never done this before but maybe you can use xp_cmdshell for this:
DECLARE @cmd varchar(500)
DECLARE @table table (cmd varchar(500))

SET @cmd = 'some dos command'

INSERT INTO @table
EXEC xp_cmdshell @cmd

SELECT * FROM @table


- Lumbago
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-19 : 05:50:51
The trick is to know or investigate which is disk 0.
You can put the partition (or mounted volume) "f:" on any disk.

I think WMI has providers for this.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -