locked
TSD02010: Incorrect syntax near $(dbvarname) RRS feed

  • Question

  • Hi there

    I am using the Database Edition GDR R2.

    I have two database projects (and one server project for master) linked using sqlcmdvars as there are several views that join tables in two databases.

    This was working ok until another developer after retrieving the whole solution from source control, added in a new view that used the sqlcmdvars.  This new view correctly used the database variable.

    On this other developers machine, all the views (both existing and the new one) using the database variables gave errors.
    Either - 'TSD02010: Incorrect syntax near $(dbvarname)' or 'TSD02010: Incorrect syntax near FROM'   

    The same occurred on my machine after retrieving the new objects from source control.

    It seems like the project has forgotten to use the database variables, but they are still defined.

    The views in question will validate ok against a database if I select the correct SqlCmd source in the toolbar.

    I cannot see what is causing the problem - any suggestions?


    Cheers
    Richard
    Wednesday, May 13, 2009 10:20 PM

Answers

  • You'll need to escape it with square brackets; [$(dbvarname)].
    Wednesday, May 13, 2009 11:01 PM
    Moderator

All replies

  • You'll need to escape it with square brackets; [$(dbvarname)].
    Wednesday, May 13, 2009 11:01 PM
    Moderator
  • Thanks Gokhan

    It all works now.  Checking the VSS history I see the square brackets were there initially.  I'm not sure why they disappeared though.  Perhaps it was retrieving the solution from VSS that did it.

    Cheers
    Richard
    Thursday, May 14, 2009 12:11 AM