Last updated: 2015-09-14
I’ve recently stumpled upon a couple of problems in a DB project in Visual Studio
1) Could not update DB with a script after Schema Compare.
Solution: Remove build errors.
In my case it was a matter of commenting out some users and permissions.
2) Could not build. Got error
System.MethodAccessException: Attempt by method ‘Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData
Solution was: Install Latest SQL Server Data Tools (SSDT)
Download Latest SQL Server Data Tools
3) Schema Compare script gave “The default schema does not exist”
Solution was change your default schema to dbo:
ALTER USER [YOURDOMAIN\YOURUSERID] WITH DEFAULT_SCHEMA=[dbo] GO
1) Ignore GRANTs in Schema Compare
Thanks to http://stackoverflow.com/users/65775/keith
2) Data compare with VS
– Tools – SQL Server – New data comparison – select DBs and compare
Above will only work if table schemas match.
If you have unselected Permissions like above, then schemas don’t match.
3) Export data script with SSMS
If above won’t work you can export data script with SSMS.
– RightClick DB – Tasks – Genrate Scrips – Next
– Select Specific DB objects – Select Tables – Next
– Advanced – General – Type of data to scripts: Data only – OK – Next – Finish