Error Publishing LightSwitch to Azure–Incorrect synax near ‘multi_user’

LightSwitch makes publishing your app to Azure drop dead easy once you know the process.  One scenario that may stump you occurs after you’ve published your app, make changes to your data model in LightSwitch, and then try to republish.  If those changes result in a SQL error, you’ll get the error below:

An exception occurred when deploying the database for the application.
Incorrect syntax near 'MULTI_USER'.

Not a very helpful error.  For me, this error has always been related to changes to the data source where a column has been deleted or perhaps changed to ‘Required’ when some of the current data has null data in that field.  The fix is to open up SQL Management Studio and fix the issue.  If you don’t want to keep the data, you can just drop the SQL tables and publish again.  I usually leave all the ASP.NET membership tables and just drop the table that was changed. 

So the key is to fix what ever SQL change the LightSwitch publishing is not liking.  For instance, I deleted two column in LightSwitch so the publish failed with the ‘Incorrect syntax near ‘MULTI_USER’.  So I just opened SQL Management Studio, deleted those two columns, and republished with no errors and all my other data was intact.  It would be great if the actually SQL error was passed down to you so you knew exactly what change was the problem, but hopefully knowing it might be related to SQL helps.

Return TopTrackbackPrintPermalink


Got something to say? Join the discussion »

leave a reply

 [Quick Submit with Ctrl+Enter]

Remember my details
Notify me of followup comments via e-mail