March 13, 2013 at 3:46 am
Hi Team,
Daily am taking the size of databases using "EXEC SP_Databases" and updating in a excel file manually,
DATABASE_NAME|DATABASE_SIZE|REMARKS
now i want to create a job to execute the above query and store the results in a table.
New table structure is
DATE_OF_EXECUTION | DATABASE_NAME |DATABASE_SIZE| REMARKS
Please help me in query
March 13, 2013 at 3:56 am
Minnu (3/13/2013)
Hi Team,Daily am taking the size of databases using "EXEC SP_Databases" and updating in a excel file manually,
DATABASE_NAME|DATABASE_SIZE|REMARKS
now i want to create a job to execute the above query and store the results in a table.
New table structure is
DATE_OF_EXECUTION | DATABASE_NAME |DATABASE_SIZE| REMARKS
Please help me in query
To insert recordset returned by stored procedure into table, the table column structure should exactly match the recordset one. Therefore you will need to do this:
CREATE TABLE #todaystats (DBName SYSNAME, DBSize INT , Remarks VARCHAR(254))
INSERT #todaystats EXEC SP_Databases
INSERT YourStatsTable
SELECT GETDATE(),* FROM #todaystats
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy