Thank you Lynn. I tried that new EXEC you listed (missing a ' ?), and I thought I added it in the right spot. But I'm not sure what you mean about populating? I did
@dbid = 5
above the BEGIN string. Is that not how I should do this?
The exec line now looks as follows:
EXEC ('DBCC fileheader(''+cast(@dbid as varchar)'+')')
This is over my head to be honest 🙂 Thank you for the helP!!