Options

Deploying Data Scripts

Is there a way to deploy data only scripts (via migration scripts) to one environment, and not another within the same release definition?  For example, we have some script to update production data, but not to TST.  I know I can deploy directly to the production environment, but then the script is included in the next release to TST.  We are using SQL Source Control to deploy to VSTS.

TIA,
David W
Tagged:

Best Answer

  • Options
    SamTouraySamTouray Posts: 13 Bronze 2
    edited March 16, 2018 3:06PM Answer ✓
    What about making your migration scripts environment aware e.g.
    IF (@@SERVERNAME = 'MyProductionServer')
    Assuming your database doesn't move servers in the meantime. I wouldn't use this technique for business logic in application code i.e. in a stored procedure, but for a one-off script I think it's Ok?
Sign In or Register to comment.