0

I have a fairly simple question - how do I generate a script from a CodeSmith template (.cst) without the generated script being run against the target database.

That is, I have a CodeSmith template file that generates CRUD SQL Server stored procedures via the following command

cs.exe "GenerateCrud.csp" -p:TargetDB=mySqlServerDb -p:TargetServer=mySqlServerInstance

...where GenerateCrud.csp invokes a template that runs against the two parameters TargetDB and TargetServer

The requirement is to generate the CRUD script without running the script against the TargetDB and TargetServer. Is there a commandline argument that accomodates this ?

Travis Ingram
  • 387
  • 5
  • 21

1 Answers1

1

Which template are you using? You'll likely find there's a property inside that csp file, e.g. "AutoExecuteStoredProcedures"

You can change that from the command line, without editing the csp file itself, as you are with the other properties, e.g:

cs.exe "GenerateCrud.csp" -p:AutoExecuteStoredProcedures=false

Kevin Blake
  • 434
  • 2
  • 5
  • Thanks Kevin - I forgot that within the template there was an explicit sqlcmd command being issued that I could control whether executed via the route you mention above – Travis Ingram Mar 17 '13 at 11:16