Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.
This repository was archived by the owner on May 7, 2024. It is now read-only.

Include-objects - order varies on different sql servers #282

Open
@vansree

Description

@vansree

Hi,

I am using and tying to get selected tables and views and stored procedures. The code works fine.

When I execute for multiple servers, each server order of objects is different. I was expecting the order is same - either the order I provided (or) by type and name (or) by name. It is not doing that. Wondering if this is the default behavior? If not, please fix it!

$Servers = "Server1\InstanceD", "Server2\InstanceQ", "Server3\InstanceU", "Server4\InstanceP"
$db = "MySQLDB"
$db_objects = "Schema.Table1", "dbo.StoredProcedure1",
"Schema.View1", "Schema.Table2",
"Schema.View2"
foreach($Server in $Servers) {
$Server2 = $Server.Replace("", "_")
$WriteToPath = "C:\User\Scripts Generated$($Server2) $($db) - objects.sql"
mssql-scripter -S $Server -d $db --exclude-headers --include-objects $db_objects -f $WriteToPath
}

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions