How can we help you today? How can we help you today?

Invoke-DlmDatabaseSchemaValidation: how to debug Incorrect Syntax errors?

I'm trying to use the schema validation from the command line but for some reason it's spitting out a bunch of errors. Unfortunately nothing useful is there to give me any context about where this is coming from:

Incorrect syntax near '-'.
Where? What's it trying to do? Where is the script it's trying to run? Where is the log file? I'm running -verbose and -debug and it's still not telling me anything I can use to figure out what to fix.

Any suggestions?

turbopocky
0

Comments

2 comments

  • Sergio R
    Hi,

    To troubleshoot Invoke-DlmDatabaseSchemaValidation errors I recommend using SQL Compare, and do a comparison between your scripts folder and an empty database.

    You can then generate a deployment script which will hopefully provide you more insight on the error.
    Sergio R
    0
  • turbopocky
    Thanks for the suggestion, I just wanted to follow up with the answer. I was able to use standalone SQL Compare without any issue, but now I also tried standalone SQL Data Compare just to see what would happen and sure enough the same error showed up. I didn't guess that Invoke-DlmDatabaseSchemaValidation would also attempt to push our static data, but that's what it was doing. It turns out we have a trigger that breaks if the database name has a hyphen in it. That's easy enough to avoid. Getting ahold of the failed script and isolating it in SSMS was what allowed me to find the problem.
    turbopocky
    0

Add comment

Please sign in to leave a comment.