1

I would like to output the results of DBCC PDW_SHOWEXECUTIONPLAN into a variable (or table, I'm not fussy!).

I know the PDW syntax is quite different when it comes to outputing results, which means everything I've tried has so far failed. I've seen some suggestions of inserting the results into a table, but I always get syntax errors

create table #1234 
(
    sql1 varchar(max)
)
with (distribution = round_robin)

insert into #1234
DBCC PDW_SHOWEXECUTIONPLAN(@did, @spid)

Parse error at line: 37, column: 2: Incorrect syntax near 'DBCC'.

McNets
  • 22,549
  • 9
  • 43
  • 80
Neil P
  • 1,184
  • 16
  • 33
  • I've found some samples [here](http://www.itprotoday.com/management-mobility/how-can-i-insert-output-dbcc-command-sql-server-table) or [here](https://stackoverflow.com/questions/5946813/how-to-catch-the-output-of-a-dbcc-statement-in-a-temptable). Maybe this helps. – McNets Feb 05 '18 at 18:03
  • @McNets It looks like those examples are for SQL Server, using the same syntax as above that gives the error, unless I have missed something – Neil P Feb 06 '18 at 10:24

0 Answers0