Generate a sql script

DerFrankDerFrank Posts: 4 New member
edited June 7, 2018 9:27AM in SQL Source Control
Hi REDGATE users / experts

I'm still at the beginning and have installed the RedGate "SQL Source Control" ... it is now also usable on SSMS 2017 ...

Here is my question:

How can I create an script to install the changes on a test server?

In my repository are many directories  ... but now I am a NewBee and I dont know how can i this generate .. hmmm

REDGATE to installed on test server is not allowes! Only on developer Server.
Only installation scripts are allowed and are previously checked by the DB admins ...

the same thing will be done on PreProd / Prod!

How is the doing to do this?

Hope you can still help me.

VG

Frank
Tagged:

Answers

  • David AtkinsonDavid Atkinson Posts: 1,462 Rose Gold 2
    edited June 7, 2018 9:27AM
    Redgate's tools do not need to be installed on the target SQL Server. They just need to be able to connect.

    If you don't have privileges to connect to the target server, but have a test database that you are confident  represents the schema state of production, then you can generate a SQL script in SQL Compare (an option in the deployment wizard) using the test DB as the target, and pass this script on to a DBA who has rights to apply the script to pre-prod or production.

    All of this can also be set up using an automated pipeline if you have a CI server and an automated release tool.
    David Atkinson
    Product Manager
    Redgate Software
  • DerFrankDerFrank Posts: 4 New member
    hello David
    Okay, maybe I did not really explain what I want to do.
    We are developing together on a database, expanding tables and adding or changing data in the tables.

    These changes are committed with the source control in the GIT repository.
    Now I want to deploy these changes as a script to a different environment in the database.

    The deployment wizard creates a script with the changes to the database object, not the data itself.

    These data are configuration data needed for generic SQL statements.

    How can I do that or is the approach completely wrong?

    brgds Frank
  • No, this should work. Have you configured those tables as static data tables?

    If so, then SQL Data Compare can deploy the static data.
    David Atkinson
    Product Manager
    Redgate Software
  • DerFrankDerFrank Posts: 4 New member
    edited June 8, 2018 3:58PM
    hi everyone

    I have createVisual Studio Team Services by Microsoft to test TFS. There is my repository.
    With SQL Source Control I pushed my database (SQL Server 2014) into this Ropository.

    So, now I want to do a build and deploy with TFS.
    All the documentations what I found are so old (partly TFS 2012) that I'm really upset that this is so complicated.

    I just want the DEV environment to provide the changes to the TEST / STAGING / PROD environment.

    How does it work ?

    Have I looked at many videos of REDGate but did not understand how the "REDGATE DML" be configured.

    Is there no step-by-step instructions on how to do this on TFS 2015/2017?

    I am already 2 days to understand this but slowly I am with my patience at the end.

    Maybe LiquiBase better.... hmm

    Hope there is someone who can explain that to me?

    VG Frank




  • We use PowerShell cmdlets for deployment, so it doesn't matter if you're using TFS Build, Jenkins or any other CI/Release tool. The best reference on how to deploy static data is the DLM Automation documentation . We're aware that our docs might not be as discoverable as they should be. Can I ask where you looked, or what you searched for to find an answer? This will help us put our docs in the right place.
    David Atkinson
    Product Manager
    Redgate Software
  • You can find step by step instructions on how to setup VSTS / TFS pipelines with SQL Source Control projects at the following addresses:
     Hope this helps.
    Andrea Angella
    Lead Software Engineer | Red Gate
    Website: www.productivecsharp.com
    Twitter: @angella_andrea
  • You can find step by step instructions on how to setup VSTS / TFS pipelines with SQL Source Control projects at the following addresses:
     Hope this helps.
    Andrea Angella
    Lead Software Engineer | Red Gate
    Website: www.productivecsharp.com
    Twitter: @angella_andrea
Sign In or Register to comment.