How to alter connection string only?










1














Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:



script_connection_as



I want to use a powershell script like this:



 $hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')


Import-Module SqlServer

foreach($server in $hashtable.Keys)

$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")

foreach($CUBE in $hashtable[$server])

####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"





that takes input a csv file




Server,Cube



server1.domain.com,Database1




and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>



However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name> element for <DataSource> is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.



i receive this error




The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.





Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string



did not work, and has been escalated to Microsoft as broken property,










share|improve this question























  • I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
    – Mötz
    Nov 10 at 6:02










  • I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
    – Mötz
    Nov 10 at 6:19










  • @Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 6:40











  • You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
    – Mötz
    Nov 10 at 10:21










  • @Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 15:44















1














Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:



script_connection_as



I want to use a powershell script like this:



 $hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')


Import-Module SqlServer

foreach($server in $hashtable.Keys)

$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")

foreach($CUBE in $hashtable[$server])

####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"





that takes input a csv file




Server,Cube



server1.domain.com,Database1




and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>



However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name> element for <DataSource> is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.



i receive this error




The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.





Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string



did not work, and has been escalated to Microsoft as broken property,










share|improve this question























  • I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
    – Mötz
    Nov 10 at 6:02










  • I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
    – Mötz
    Nov 10 at 6:19










  • @Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 6:40











  • You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
    – Mötz
    Nov 10 at 10:21










  • @Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 15:44













1












1








1


1





Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:



script_connection_as



I want to use a powershell script like this:



 $hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')


Import-Module SqlServer

foreach($server in $hashtable.Keys)

$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")

foreach($CUBE in $hashtable[$server])

####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"





that takes input a csv file




Server,Cube



server1.domain.com,Database1




and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>



However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name> element for <DataSource> is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.



i receive this error




The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.





Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string



did not work, and has been escalated to Microsoft as broken property,










share|improve this question















Apparently the databases/cubes in an analysis server contain "script connection as > alter" option like so:



script_connection_as



I want to use a powershell script like this:



 $hashtable = @
Import-Csv "CSV_file" | ForEach-Object
$hashtable += @$($_.Server) = ($_.Cube -split 's*,s*')


Import-Module SqlServer

foreach($server in $hashtable.Keys)

$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("$server")

foreach($CUBE in $hashtable[$server])

####### Setting connection property for $Cube #######
"
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>$CUBE</DatabaseID>
</Object>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xsi:type="RelationalDataSource">
<ConnectionString>Connection Timeout=60;User Id=someID;Password=pass;Data Source=td.domain.com;Persist Security Info=True;Session Character Set=UTF8</ConnectionString>
</DataSource>
</ObjectDefinition>
</Alter>
"





that takes input a csv file




Server,Cube



server1.domain.com,Database1




and loops through the databases/cubes in the server to alter their DataSource <ConnectionString>



However i am sure that there is something missing in that script, but the thing is if i run that XML in SSMS, it complain about the <Name> element for <DataSource> is required. i understand that the full XML is needed, but it wont work from a script perspective that i am trying to accomplish because i cant have the same DataSource for other databases i have in the server. they are all possibly different, so the ID, Name, etc...have to be removed from the XML query in powershell script.



i receive this error




The object definition supplied for the ALTER statement is of a different type that the object reference to be altered.





Note: The reason i am not using analysis server properties instead is because the analysis properties method i was trying here ConnectionString property not printing connection string



did not work, and has been escalated to Microsoft as broken property,







sql sql-server xml powershell azure-analysis-services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 22:13

























asked Nov 9 at 21:23









Cataster

14012




14012











  • I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
    – Mötz
    Nov 10 at 6:02










  • I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
    – Mötz
    Nov 10 at 6:19










  • @Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 6:40











  • You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
    – Mötz
    Nov 10 at 10:21










  • @Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 15:44
















  • I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
    – Mötz
    Nov 10 at 6:02










  • I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
    – Mötz
    Nov 10 at 6:19










  • @Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 6:40











  • You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
    – Mötz
    Nov 10 at 10:21










  • @Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
    – Cataster
    Nov 10 at 15:44















I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02




I would say that you need to find a way to retrieve the XML first. Then you can build a valid alter XML and send that back to the server.
– Mötz
Nov 10 at 6:02












I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19




I'm on mobile, so sorry for not being able to validate this. But look at this and see if you can get all the details about a data source: mobile.databasejournal.com/features/mssql/…
– Mötz
Nov 10 at 6:19












@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40





@Mötz yes, that's what I need help with here, finding a way to ultimately alter the XML file, whether by retrieving it or annotating it like I have in the script. As for your suggested thread, I have tried invokeASCmd, like so: $cs = "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" Import-Csv $CSV_file | ForEach-Object{ Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString $cs ....but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 6:40













You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21




You have me a bit confuses with the details. I have placed answer on your other question. Lets take the discussion there.
– Mötz
Nov 10 at 10:21












@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44




@Mötz I was saying that I tried this: Invoke-ASCmd -Server $_.Server -Database $_.Cube -ConnectionString "ConnectionTimeout=60;UserId=someID;Password=pass;DataSource=td.domain.com;Persist Security Info=True;Session Character Set=UTF8" ..... but I got error: Invoke-ASCmd : Parameter set cannot be resolved using the specified named parameters
– Cataster
Nov 10 at 15:44












2 Answers
2






active

oldest

votes


















1














We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.



Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)



If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.



Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)



We found that this works



Import-Module SqlServer

$newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"

$svr = new-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect("server1.domain.com")

$svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
$svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)





share|improve this answer




























    1














    So - based on the findings from @thom schumacher from your other question (located here)



    $Analysis_Server = New-Object Microsoft.AnalysisServices.Server
    $Analysis_Server.connect("AX2012R2A")

    #Getting current state
    PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
    ring
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5

    #Setting the new connection string in variable
    $connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"

    #Assigning the variable to one of the databases
    $Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString

    #Remember to update the new configuration back to the database
    $Analysis_Server.Databases[0].datasources[0].Update()

    #Getting the new configuration
    PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
    ring
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
    Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5


    Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40



    That is how you only change the details of the connection string, using PowerShell and SMO.






    share|improve this answer




















    • it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
      – Cataster
      Nov 10 at 23:39











    • Have you tried level 1200, sql 2016?
      – Mötz
      Nov 10 at 23:43










    • i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
      – Cataster
      Nov 10 at 23:46










    • I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
      – Mötz
      Nov 10 at 23:47










    • uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
      – Cataster
      Nov 10 at 23:47










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233436%2fhow-to-alter-connection-string-only%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.



    Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)



    If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.



    Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)



    We found that this works



    Import-Module SqlServer

    $newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"

    $svr = new-Object Microsoft.AnalysisServices.Tabular.Server
    $svr.Connect("server1.domain.com")

    $svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
    $svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)





    share|improve this answer

























      1














      We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.



      Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)



      If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.



      Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)



      We found that this works



      Import-Module SqlServer

      $newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"

      $svr = new-Object Microsoft.AnalysisServices.Tabular.Server
      $svr.Connect("server1.domain.com")

      $svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
      $svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)





      share|improve this answer























        1












        1








        1






        We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.



        Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)



        If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.



        Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)



        We found that this works



        Import-Module SqlServer

        $newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"

        $svr = new-Object Microsoft.AnalysisServices.Tabular.Server
        $svr.Connect("server1.domain.com")

        $svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
        $svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)





        share|improve this answer












        We learned together that SQL Server 2016 or higher works with at compatibility level of 1200 or higher. Whenever you work on level 1200 or higher you are not able to use the classic AMO objects to work the the different properties.



        Microsoft actually states this very clearly: Programming with Analysis Management Objects (AMO)



        If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM). TOM is an extension of the Analysis Services Management Object (AMO) client library.



        Learning about TOM is just like learning about AMO back in the days. You have to start somewhere like this: Tabular Object Model (TOM)



        We found that this works



        Import-Module SqlServer

        $newConnectionString = "Connection Timeout=60;User Id=SOME_NEW_ID;Data Source=10.10.19.10;Persist Security Info=True;Session Character Set=UTF8"

        $svr = new-Object Microsoft.AnalysisServices.Tabular.Server
        $svr.Connect("server1.domain.com")

        $svr.databases[1].model.datasources[0].ConnectionString = $newConnectionString
        $svr.Databases[1].Update([Microsoft.AnalysisServices.UpdateOptions]::ExpandFull)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 18:37









        Mötz

        807610




        807610























            1














            So - based on the findings from @thom schumacher from your other question (located here)



            $Analysis_Server = New-Object Microsoft.AnalysisServices.Server
            $Analysis_Server.connect("AX2012R2A")

            #Getting current state
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5

            #Setting the new connection string in variable
            $connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"

            #Assigning the variable to one of the databases
            $Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString

            #Remember to update the new configuration back to the database
            $Analysis_Server.Databases[0].datasources[0].Update()

            #Getting the new configuration
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5


            Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40



            That is how you only change the details of the connection string, using PowerShell and SMO.






            share|improve this answer




















            • it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
              – Cataster
              Nov 10 at 23:39











            • Have you tried level 1200, sql 2016?
              – Mötz
              Nov 10 at 23:43










            • i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
              – Cataster
              Nov 10 at 23:46










            • I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
              – Mötz
              Nov 10 at 23:47










            • uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
              – Cataster
              Nov 10 at 23:47















            1














            So - based on the findings from @thom schumacher from your other question (located here)



            $Analysis_Server = New-Object Microsoft.AnalysisServices.Server
            $Analysis_Server.connect("AX2012R2A")

            #Getting current state
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5

            #Setting the new connection string in variable
            $connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"

            #Assigning the variable to one of the databases
            $Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString

            #Remember to update the new configuration back to the database
            $Analysis_Server.Databases[0].datasources[0].Update()

            #Getting the new configuration
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5


            Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40



            That is how you only change the details of the connection string, using PowerShell and SMO.






            share|improve this answer




















            • it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
              – Cataster
              Nov 10 at 23:39











            • Have you tried level 1200, sql 2016?
              – Mötz
              Nov 10 at 23:43










            • i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
              – Cataster
              Nov 10 at 23:46










            • I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
              – Mötz
              Nov 10 at 23:47










            • uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
              – Cataster
              Nov 10 at 23:47













            1












            1








            1






            So - based on the findings from @thom schumacher from your other question (located here)



            $Analysis_Server = New-Object Microsoft.AnalysisServices.Server
            $Analysis_Server.connect("AX2012R2A")

            #Getting current state
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5

            #Setting the new connection string in variable
            $connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"

            #Assigning the variable to one of the databases
            $Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString

            #Remember to update the new configuration back to the database
            $Analysis_Server.Databases[0].datasources[0].Update()

            #Getting the new configuration
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5


            Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40



            That is how you only change the details of the connection string, using PowerShell and SMO.






            share|improve this answer












            So - based on the findings from @thom schumacher from your other question (located here)



            $Analysis_Server = New-Object Microsoft.AnalysisServices.Server
            $Analysis_Server.connect("AX2012R2A")

            #Getting current state
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_4
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5

            #Setting the new connection string in variable
            $connectionString = "Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40"

            #Assigning the variable to one of the databases
            $Analysis_Server.Databases[0].datasources[0].ConnectionString = $connectionString

            #Remember to update the new configuration back to the database
            $Analysis_Server.Databases[0].datasources[0].Update()

            #Getting the new configuration
            PS C:UsersAdministrator> $Analysis_Server.Databases | ForEach-Object ForEach-Object $_.ConnectionSt
            ring
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_40
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_2
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_1
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_6
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_3
            Provider=SQLNCLI11.1;Data Source=AX2012R2A;Integrated Security=SSPI;Initial Catalog=DatabaseName_5


            Please pay attention to the first entry in each list. It went from DatabaseName_4 to DatabaseName_40



            That is how you only change the details of the connection string, using PowerShell and SMO.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 10 at 23:21









            Mötz

            807610




            807610











            • it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
              – Cataster
              Nov 10 at 23:39











            • Have you tried level 1200, sql 2016?
              – Mötz
              Nov 10 at 23:43










            • i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
              – Cataster
              Nov 10 at 23:46










            • I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
              – Mötz
              Nov 10 at 23:47










            • uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
              – Cataster
              Nov 10 at 23:47
















            • it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
              – Cataster
              Nov 10 at 23:39











            • Have you tried level 1200, sql 2016?
              – Mötz
              Nov 10 at 23:43










            • i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
              – Cataster
              Nov 10 at 23:46










            • I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
              – Mötz
              Nov 10 at 23:47










            • uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
              – Cataster
              Nov 10 at 23:47















            it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
            – Cataster
            Nov 10 at 23:39





            it works for compatibility level 1103 databases! finally, but it doesnt work for databases with level 1400. i get this error: The property 'ConnectionString' cannot be found on this object. Verify that the property exists and can be set. .... what is the property then for such level? is it different for the 2017 SQL server?
            – Cataster
            Nov 10 at 23:39













            Have you tried level 1200, sql 2016?
            – Mötz
            Nov 10 at 23:43




            Have you tried level 1200, sql 2016?
            – Mötz
            Nov 10 at 23:43












            i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
            – Cataster
            Nov 10 at 23:46




            i cant since i dont have databases of that level. even i had 1200 level databases, i still need it to work for level 1400 (SQL server 2017) however, there is something important to note: apparently the "SQL Server 2012 SP1 or later (1103)" databases, when i try altering the connection as script in SSMS, it shows up as an XML (XMLA) file. however, for the databases with "SQL Server 2017 (1400)", it is not alter, but instead its "replace to" and it generates a JSON file!
            – Cataster
            Nov 10 at 23:46












            I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
            – Mötz
            Nov 10 at 23:47




            I believe you need to carefully read this link docs.microsoft.com/en-us/bi-reference/amo/…
            – Mötz
            Nov 10 at 23:47












            uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
            – Cataster
            Nov 10 at 23:47




            uh ha! If you are programming for tabular models at 1200 or higher compatibility level, use the Tabular Object Model (TOM).
            – Cataster
            Nov 10 at 23:47

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233436%2fhow-to-alter-connection-string-only%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)