-
Thanks for your comments skasarla. I have amended my script as you suggested (without the temp table) and I can get it to work now.
The problem was originally I had this:-
INSERT INTO FreeSpaceData EXEC master..xp_fixeddrives
GO
instead of this:- (DOH!)
INSERT INTO FreeSpaceData (drive,mb_free) EXEC master..xp_fixeddrives
GO -- i.e the column names
/**************************************/
if exists (select * from dbo.sysobjects where id = object_id(N'FreeSpaceData') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table FreeSpaceData
GO
CREATE TABLE FreeSpaceData (
Drive char (1) ,
MB_Free int NULL ,
interval datetime default getdate() not null
)
GO
INSERT INTO FreeSpaceData (drive,mb_free) EXEC master..xp_fixeddrives
GO
select * from freespacedata
/**************************************/
Many thanks to all of you for your help/suggestions. It's much appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|