• Lynn Pettis (4/17/2013)


    I can see the problem, you have an extra single before the cast and before the final + sign.

    Look at what I had posted earlier.

    EXEC ('DBCC fileheader(' + cast(@dbid as varchar)' + ')')

    That's the one from earlier that you posted, which is missing a ' (or has 1 too many?). I've tried putting it everywhere I think it should go, and get 1 error or another haha. So now I have:

    EXEC ('DBCC fileheader(' + cast(@dbid as varchar) + ')')

    And that is giving me "incorrect syntax near cast". I removed the quote before the last +. I've also tried putting ' around the '@dbid as varchar' and still got syntax. Sorry to be a bother! :-\ Thank you for all the help though!