create a region like in visual studio

  • Hi,
    is it possible to create a region at SQL Server 2017?
    I tried it with

    begin -- create databases for testing
    create database dbSource -- sdfsdf
    create database dbWork -- sdfsdfsdf
    create database dbDest_trial -- sdfsdf
    end
    go

    This is working pretty well:

    But if you have to use any "go" within the "region"  then it stops at go:


    begin -- create databases for testing
    create database dbSource -- sdfsdf
    go
    create database dbWork -- sdfsdfsdf
    go
    create database dbDest_trial -- sdfsdf
    go
    end
    go


    Has anybody a solution for making something like a region in T-SQL?

    Thank you,
    Sue

    Susanne

  • Sue-651097 - Friday, August 10, 2018 6:30 AM

    Hi,
    is it possible to create a region at SQL Server 2017?
    I tried it with

    begin -- create databases for testing
    create database dbSource -- sdfsdf
    create database dbWork -- sdfsdfsdf
    create database dbDest_trial -- sdfsdf
    end
    go

    This is working pretty well:

    But if you have to use any "go" within the "region"  then it stops at go:


    begin -- create databases for testing
    create database dbSource -- sdfsdf
    go
    create database dbWork -- sdfsdfsdf
    go
    create database dbDest_trial -- sdfsdf
    go
    end
    go


    Has anybody a solution for making something like a region in T-SQL?

    Thank you,
    Sue

    There is a third-party tool called SSMSBoost which allows you to create your own regions. See here. I've been using it for years to help keep long scripts manageable.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin - Friday, August 10, 2018 6:34 AM

    Sue-651097 - Friday, August 10, 2018 6:30 AM

    Hi,
    is it possible to create a region at SQL Server 2017?
    I tried it with

    begin -- create databases for testing
    create database dbSource -- sdfsdf
    create database dbWork -- sdfsdfsdf
    create database dbDest_trial -- sdfsdf
    end
    go

    This is working pretty well:

    But if you have to use any "go" within the "region"  then it stops at go:


    begin -- create databases for testing
    create database dbSource -- sdfsdf
    go
    create database dbWork -- sdfsdfsdf
    go
    create database dbDest_trial -- sdfsdf
    go
    end
    go


    Has anybody a solution for making something like a region in T-SQL?

    Thank you,
    Sue

    There is a third-party tool called SSMSBoost which allows you to create your own regions. See here. I've been using it for years to help keep long scripts manageable.

    Hi Phil,
    thanks for the tool information! I just installed it and tried region and formating. Works great!
    I use trial version now and will stay at free version afterwards - will see how it works with the updates.
    Thanks, Sue

    Susanne

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply