How can we improve Microsoft Azure SQL Data Warehouse ?

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
)
WITH
(
DISTRIBUTION = HASH([ROWS])
, HEAP
)

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'.

18 votes
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)

We’ll send you updates on this idea

Luke shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base