GitHub Integeration with SQL Server.

Anonymous
2023-02-22T10:26:41+00:00

Hello,

I am trying to Find some steps on How we can Integerate the Github with SQL.

We have SQL Scripts in the DataBase, Once we make any changes it should also make changes in the Same Scripts Available in GitHub.

Please Suggest....

Microsoft 365 and Office | Install, redeem, activate | Other | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. Anonymous
    2023-02-22T12:47:08+00:00

    You might need to check the Github docs for that

    https://docs.github.com/en/actions

    0 comments No comments
  2. Anonymous
    2023-02-22T12:38:21+00:00

    Ok Got it Now Anna, I will try above steps if it's working.

    Do you have any idea how I can automate it?

    Like GitHub Actions for Example.

    0 comments No comments
  3. Anonymous
    2023-02-22T12:17:49+00:00

    To make changes to SQL scripts on the SQL Server and have the changes automatically reflected in the Git repository on GitHub, you need to stage, commit, and push the changes using Git commands. Multiple users can work on the same Git repository by following the same process.

    To do so, follow the below steps:

    Make changes to the SQL scripts on the SQL Server.

    Open the Git Bash or command prompt and navigate to the directory where the SQL scripts are located.

    Use the git add command to stage the changes you made to the SQL scripts.

    For example, if you modified a script named test.sql, you can stage the changes by running the command git add test.sql.

    Use the git commit command to commit the changes to the Git repository.

    For example, you can commit the changes with the command git commit -m "Updated test.sql script."

    Finally, use the git push command to push the changes to the GitHub repository.

    For example, you can push the changes with the command git push origin main.

    0 comments No comments
  4. Anonymous
    2023-02-22T11:42:14+00:00

    Hi Anna,

    As of now, I have created a Repo in GitHub and the scripts available in SQL Server are Available in That Repo.

    So Now I want to make changes in the Script available in SQL Server and it should reflect Automatically in the Script Present in GitHub.

    But we need to to Do git init, git add . etc eachtime right ?

    Or if you share me a detailed steps that helps.

    What if 10 users are making the changes in the SQL Scripts and how will it reflect in GitHub.

    0 comments No comments
  5. Anonymous
    2023-02-22T11:01:22+00:00

    Hi Prashandh

    I'm AnnaThomas and I'd be happy to help you with your question. In this Forum, we are Microsoft consumers just like yourself.

    To integrate Github with SQL Server and have changes made in SQL Scripts automatically update in Github, you can follow the steps below:

    Set up a repository on Github and clone it to your local machine where the SQL Server is installed.

    Install Git on the machine where SQL Server is installed. You can download Git from the official website.

    Open the SQL Server Management Studio and navigate to the SQL Scripts you want to integrate with Github.

    Initialize a local Git repository in the directory containing your SQL Scripts by running the command git init in the command prompt or Git Bash.

    Add the SQL Scripts to the Git repository by running the command git add . in the command prompt or Git Bash.

    Commit the changes by running the command git commit -m "initial commit".

    Link the local Git repository to the Github repository by running the command git remote add origin <Github repository URL>.

    Push the changes to the Github repository by running the command git push -u origin main.

    After performing the above steps, any changes made to the SQL Scripts on the SQL Server will be automatically reflected in the Github repository when you push those changes.

    By following these steps, you can integrate Github with SQL Server and have your SQL Scripts versioned and available on Github.

    I hope this helps ;-), let me know if this is contrary to what you need, I would still be helpful to answer more of your questions.

    Best Regards,

    AnnaThomas

    Give back to the community. Help the next person with this problem by indicating whether this answer solved your problem. Click Yes or No at the bottom.

    0 comments No comments