Allow DBCC results (e.g. DBCC PDW_SHOWSPACEUSED..) to be copied into yet another table for programmatic interaction with those results?
IF OBJECTID('tempdb..#showspace_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 @DynamicSQL nvarchar(4000)
SET @DynamicSQL = (SELECT CONVERT(NVARCHAR(100),'DBCC PDW_SHOWSPACEUSED("dbo.TableName");'))
INSERT INTO #showspaceused ([ROWS], [RESERVEDSPACE], [DATASPACE], [INDEXSPACE], [UNUSEDSPACE], [PDWNODEID], [DISTRIBUTIONID])
EXEC spexecutesql @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!