Hi everyone. I have created a table using the following code in sql2008:
CREATE TABLE dbo.databaseDataFileSize (
rowId INT IDENTITY(1,1),
I am trying to alter a script to run which should populate the table using the Sp_MsforeachDb. I am running the follwoing code to try this :
INSERT INTO Dba_admin.dbo.databaseDataFileSize
SELECT ''?'', SUM(size) * 8, cast(getdate() as date), cast(getdate() as time)
WHERE type = 0;
but i am getting the following error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '?'.
Can anybody help me modify this so it itterates through each database and populates the table so i can keep track of my datafile sizes ?