How to deploy BIML script to create database -
i learning biml bimlscript.com , walked through steps here: http://www.bimlscript.com/walkthrough/details/3111. have creating new table database on localhost. how run using biml express? visual studio's bimlexpress menu gives option generate ssis package.
generate ssis package or check errors both evaluate biml , bimlscript.
as quick summary of article, shows model or describe relational artifacts (database/schema/table) biml. can done manually or via reverse engineering getdatabaseschema.
the thing is, these artifacts in-memory. compiler done generating ssis package or checking errors, go away. looking have button or bimlexpress "make database objects."
that doesn't exist directly - can build tooling need more bimlscript. can inspect evaluated biml using tiering , evaluating rootnode's biml
the referenced article doesn't show using getdropandcreateddl
method. invoking against in memory relational objects (database/schema/table) translate biml sql definition.
what need figure out whether want run sql every time, generate sql text files or make ssis package execute run sql commands.
for example, bit of biml generate preview window drop , create statements need.
<biml xmlns="http://schemas.varigence.com/biml.xsd"> <# foreach(var db in rootnode.databases) { writeline(db.getdropandcreateddl()); } foreach(var schema in rootnode.schemas) { writeline(schema.getdropandcreateddl()); } foreach(var table in rootnode.tables) { writeline(table.getdropandcreateddl()); } #> </biml>
if wanted save file, replace writeline calls system.io.file.writealltext
if want fire off sql commands, it's going bit more complex you'd need instantiate connection manager associated database , run ddl.
Comments
Post a Comment