Query execution failed for dataset 'BOL'. Incorrect syntax near 'T1'

Anyone experienced this scenario or have suggestions on how to resolve an SSRS error like this?

A customized (from the base BOLForm) RDD for a customized Bill of Lading SSRS report fails with the error:

Incorrect syntax near ‘T1’.
----------------------------
Query execution failed for dataset ‘BOL’. (rsErrorExecutingCommand)
----------------------------
An error has occurred during report processing. (rsProcessingAborted)

  • If I run the SSRS in Report Builder and paste in a valid GUID it fails with the above error.
  • If I create a blank SSRS and add this same BOL dataset query, it fails.
  • If I take this BOL dataset query out of SSRS, replace the " + Parameters!TableGuid.Value + " with a valid GUID and put that query into SSMS it runs fine.
  • If I copy that modified, query (with the hard-coded GUID added) from SSMS and put it into the SSRS dataset, the SSRS actually runs fine. (Obviously I cannot leave a hard-coded GUID in there though.)
  • Tried copying the dataset query from the standard ssrs, put that into the blank SSRS and that works, but as soon as I try to add even just one of the extra tables back into the parameterized (" + Parameters!TableGuid.Value + ") dataset query, the SSRS fails to run.

Seems real odd that it runs in SSMS, but fails in SSRS.

Suggestions or ideas?

SSRS Is REAL picky about Line / Feed / New Lines. Make sure you don’t have extra ones of those in your DataSet query… I usually remove them all when I copy the query back in.