0

Using changesets that call SQL Server scripts, there are some identical scripts which perform some work where the only difference is a version number (string).

To consolidate code, a stored procedure was considered which would take a parameter (version string).

How can a stored procedure, with a parameter, be called from a changeset? I've seen one example for Oracle but it doesn't seem to work for SQL Server.

JeffM23
  • 3
  • 2
  • 1
    What does "doesn't seem to work" mean? Add a link to the oracle example you refer to. Show some code. Add error messages. The more specific your question is the more likely you get answers. – Jens Feb 08 '19 at 15:55
  • Let me rephrase my ask please. I want to call a SQL Server stored procedure, with parameter, from a changeset. Would someone who has done this before, or knows how to do this, please post an example of calling a SQL Server stored procedure, with a parameter, from a changeset? Thank you. – JeffM23 Feb 10 '19 at 21:36
  • Liquibase is about creating DB structure. That is why it has a [`createProcedure`](http://www.liquibase.org/documentation/changes/create_procedure.html) change. But it will only create your procedure. If you want to run a procedure (which is actually not what liquibase is about) you might be able to get this running by using [`sql change`](https://www.liquibase.org/documentation/changes/sql.html). And in it call your stored procedure with something like "call – Jens Feb 11 '19 at 07:39
  • And maybe you can use [`changelog_parameters`](http://www.liquibase.org/documentation/changelog_parameters.html) to pass in a parameter. – Jens Feb 11 '19 at 07:41

0 Answers0