|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, December 04, 2012 7:27 AM
Points: 208,
Visits: 49
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 1:15 PM
Points: 423,
Visits: 1,948
|
|
I think this'll give you the same result with a lot less work:
declare @foo table (drive char(1),mbfree int) INSERT INTO @foo EXEC master..xp_fixeddrives IF @@rowcount = 26 SELECT '*' as drive ELSE SELECT TOP 1 drive FROM @foo ORDER BY drive
Or to see all the details:
declare @foo table (drive char(1),mbfree int) INSERT INTO @foo EXEC master..xp_fixeddrives SELECT * FROM @foo
Warning; xp_fixeddrives IS undocumented
Cursors are useful if you don't know SQL
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:47 PM
Points: 3,516,
Visits: 1,112
|
|
A small point - VERY SMALL - is that Available is spelt incorrectly. Thought you might want to correct the article.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!
|
|
|
|