Allow DBCC results (e.g. DBCC PDW_SHOWSPACEUSED..) to be copied into yet another table for programmatic interaction with those results?
IF OBJECT_ID('tempdb..#show_space_used') IS NOT NULL
DROP TABLE #show_space_used
CREATE TABLE #show_space_used
[ROWS] INT NULL
, [RESERVED_SPACE] INT NULL
, [DATA_SPACE] INT NULL
, [INDEX_SPACE] INT NULL
, [UNUSED_SPACE] INT NULL
, [PDW_NODE_ID] INT NULL
, [DISTRIBUTION_ID] INT NULL
DISTRIBUTION = HASH([ROWS])
DECLARE @Dynamic_SQL nvarchar(4000)
SET @Dynamic_SQL = (SELECT CONVERT(NVARCHAR(100),'DBCC PDW_SHOWSPACEUSED("dbo.TableName");'))
INSERT INTO #show_space_used ([ROWS], [RESERVED_SPACE], [DATA_SPACE], [INDEX_SPACE], [UNUSED_SPACE], [PDW_NODE_ID], [DISTRIBUTION_ID])
EXEC sp_executesql @Dynamic_SQL
Msg 103010, Level 16, State 1, Line 326
Parse error at line: 25, column: 1: Incorrect syntax near 'EXEC'.
Thank you for your request. This item is on our backlog. We will update this thread when the status changes.
Really weak of Microsoft not to go close to this question - even after such a long time. We all know why. Better watch it that the popularity of the enterprise stuff (including Azure) goes the same way Windows 10 is headed...Going too "indian" with low quality code, missed functionality...and then "face saving" is not the way!