0

I am new to Devops. I want to Execute/Deploy SQL script to sql server through Devops(CI-CD). I would like to know what are the possible options to achieve this and which is the preferable one Security wise and performance wise ???

My SQLscript will mostly contains 4, 5 Insert/update Script or 1 Procedure or function.

6
  • Does this answer your question? how to execute sql script using azure devops pipeline Commented Feb 3, 2021 at 10:53
  • 1
    No. it is taking about sql scripts. we need to go for DACPAC Commented Feb 3, 2021 at 10:56
  • @priyankagharat, updated my answer. please refer to that Commented Feb 8, 2021 at 11:24
  • Thank you @VenkataramanR for reply..... I have .PS1 file which contains Insert scripts and Rest stuff to deploy other things(other than SQL) Is it possible to read those specific SQL scripts(mentioned below) from .PS1 using "inlinescript". How???(what will be inlinescript?) Could you please help me in this And when to prefer DACPAC Script,sqlscript or Inlinescript... Example: <# DEV Script 1 INSERT INTO Table1(.......) VALUES (.........) Script 2 INSERT INTO Table1(.......) VALUES (.........) Script 3 INSERT INTO Table1(.......) VALUES (.........) #> Commented Feb 8, 2021 at 13:16
  • these insert scripts will be part of pre-deployment script. no need to have this as separate .ps1 file. Also, I would suggest you to raise separate question on this. Adding more information to same question and updating answer, will lead to confusion for future readers of this question Commented Feb 8, 2021 at 13:59

1 Answer 1

2

Generally, it is best practice to deploy the SQL server database code as DACPAC in DevOps in CI/CD manner.

Read more Azure pipelines for SQL deployment

You can refer to the blog posts, which provide step by step for the same:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.