Closed whibdev closed 1 year ago
var ddlGeneratorFactory = new DdlGeneratorFactory(SqlType.SqlServer);
//as now
var ddl = ddlGeneratorFactory.AllTablesGenerator(schema).Write();
//new option- only works for SqlServer
ddlGeneratorFactory.UseGranularBatching = true;
var dllWithBatching = ddlGeneratorFactory.AllTablesGenerator(schema).Write();
Pre-release here https://github.com/martinjw/dbschemareader/releases/tag/2.8.2.2
The update resolves the issue
Do you have a publish timeline for this update?
It's released and on nuget.
I’m using the DdlGeneratorFactory to generate table scripts from an existing SqlServer (2023) datbase and saving them in separate files in a sql database project (sqlproj). Sample output of one table script looks like this:
When I use the ‘dotnet build’ command to compile the project to a dacfac file, I get a build error due to invalid syntax.
The issue is caused by using a semicolon to terminate a statement, instead of a ‘GO’ command, between statements in the same file. When I manually edit the generated table files output (as follows) by adding a ‘GO’ command between the statements, the build works.
Please note: The current output (without the ‘GO’ statement) parses and executes without error in SSMS.
Is there any way to optionally add a GO statement as described to avoid the 'dotnet build' errors?