Skip to main content
added 16 characters in body
Source Link
McNets
  • 23.9k
  • 11
  • 50
  • 89

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

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

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

Source Link
Neil P
  • 1.3k
  • 3
  • 19
  • 38

Output result of DBCC PDW_SHOWEXECUTIONPLAN into a variable

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