« first day (1473 days earlier)      last day (2845 days later) » 

11:11 AM
Can I ask something about MSSQL here?
 
11:29 AM
I want to export Export SQL Server info about disk, cpu and memory utilization into a log file. I have come across the following script.

IF OBJECT_ID('tempdb.dbo.#space') IS NOT NULL
DROP TABLE #space

CREATE TABLE #space (
database_id INT PRIMARY KEY
, data_used_size DECIMAL(18,2)
, log_used_size DECIMAL(18,2)
)

DECLARE @SQL NVARCHAR(MAX)

SELECT @SQL = STUFF((
SELECT '
USE [' + d.name + ']
INSERT INTO #space (database_id, data_used_size, log_used_size)
SELECT
DB_ID()
, SUM(CASE WHEN [type] = 0 THEN space_used END)
 
 
12 hours later…
11:51 PM
Looking at this on the phone but doesn't temp tables reside in tempdb.dbo.#space (there's also a suffix but SQL Server can remove that)
Probably not the answer but would need to test this to find out
By that I mean your bcp command. Does select * from dbo.#space return anything?
 

« first day (1473 days earlier)      last day (2845 days later) »