November 17, 2014 at 9:55 am
Hi
Just trying to make weekly reports for 'Adventure works' database using sp_spaceused (not tables).
CREATE TABLE [dbo].[SSP_SpaceUsed](
[LogDate] [datetime] NOT NULL,
[database_name] [nvarchar](128) NULL,
[database_size] [varchar](18) NULL,
[unallocated space] [varchar](18) NULL,
[reserved] [varchar](18) NULL,
[data] [varchar](18) NULL,
[index_size] [varchar](18) NULL,
[unused] [varchar](18) NULL,
INSERT [dbo].[SSP_SpaceUsed] EXEC sp_spaceused --also tried with ('adventureWorks')???
Error: Column name or number of supplied values does not match table definition.
But not working. Can anyone help?
November 17, 2014 at 10:12 am
sp_spaceused returns 2 resultsets
Type the following to see the schema "EXEC sp_helptext sp_spaceused".
There might be a some DMVs out there that give you the information that you require.
November 17, 2014 at 10:16 am
see this thread
November 17, 2014 at 10:21 am
Here is a script that will make it very easy to get the space used and to insert it into a table.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 17, 2014 at 10:40 am
I'd love to see INSERT/EXECUTE have the ability to designate which resultset to insert.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply