Unable to exclude tables from schema update
alphalpha
Posts: 3
I have a reference DB that contains a couple of tables that are used only for primary key management during database builds. These tables are not intended to be included in the DB instances that I upgrade using SQLPackager. I use the sqlpackager command line tool to build the upgrade scripts, but I can't seem to configure the /excludescheme and /includeschema arguments to exclude these tables.
I use an XML argument file for sqlpackager command-line tool. As for the ex/includeschema arguments, I've tried all of the following:
1. <excludeschema>Table:@PrimaryKey</excludeschema>
<excludeschema>Table:@LocalizationKey</excludeschema>
<includeschema>Table</includeschema>
<includeschema>View</includeschema>
2. <excludeschema>Table:@PrimaryKey</excludeschema>
<excludeschema>Table:@LocalizationKey</excludeschema>
<includeschema>View</includeschema>
3. <excludeschema>Table:@.*</excludeschema>
<includeschema>Table</includeschema>
<includeschema>View</includeschema>
4. <includeschema>Table</includeschema>
<includeschema>View</includeschema>
<excludeschema>Table:@.*</excludeschema>
In every case, in the sqlpackager output, I see:
The first two lines items need to disappear. SQL code for creating these tables in the target DB is also included in the scripts produced by sqlpackager.
What do I do to exclude these tables from the package scripts?
I use an XML argument file for sqlpackager command-line tool. As for the ex/includeschema arguments, I've tried all of the following:
1. <excludeschema>Table:@PrimaryKey</excludeschema>
<excludeschema>Table:@LocalizationKey</excludeschema>
<includeschema>Table</includeschema>
<includeschema>View</includeschema>
2. <excludeschema>Table:@PrimaryKey</excludeschema>
<excludeschema>Table:@LocalizationKey</excludeschema>
<includeschema>View</includeschema>
3. <excludeschema>Table:@.*</excludeschema>
<includeschema>Table</includeschema>
<includeschema>View</includeschema>
4. <includeschema>Table</includeschema>
<includeschema>View</includeschema>
<excludeschema>Table:@.*</excludeschema>
In every case, in the sqlpackager output, I see:
Object type Name DB1 DB2 --------------------------------------------- Table [dbo].[@LocalizationKey] >> Table [dbo].[@PrimaryKey] >> Table [dbo].[ActionItem] >> Table [dbo].[ActionItemComment] >> etc
The first two lines items need to disappear. SQL code for creating these tables in the target DB is also included in the scripts produced by sqlpackager.
What do I do to exclude these tables from the package scripts?
aLpHaLpHa
Comments
5. <includeschema>Table</includeschema>
<includeschema>View</includeschema>
<excludeschema>Table:\[@PrimaryKey\]</excludeschema>
<excludeschema>Table:\[@LocalizationKey\]</excludeschema>