As SQL DMO is deprecated now, I need to modify the below line in a javascript file to create SQL SMO automation object in Javascript using ActiveXObject :
var sql;
sql = new ActiveXObject("SQLDMO.SQLServer");
The above snippet is throwing Automation server can't create object.
The client system where this is running has SQL server 2014. I tried the below but the got the same error :
var sql;
sql = new ActiveXObject("Microsoft.SqlServer.Management.Smo.Server");
I also checked whether my system has SQL SMO installed or not in PowerShell :
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
I got the location of Microsoft.SqlServer.Smo.dll as output: C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\12.0.0.0__89845dcd8080cc91
Please help me in creating the automation object using SQL SMO.