Cant get it to work

Aug 29, 2012 at 12:06 PM

I want to know what I am doing wrong here...this is what I am doing:

E:ScriptSqlConfig.exe /DEBEHQSQ03 /DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL"

and dont receive any output...what do I need to adjust? 

Thanks for your help. I appreciate it guys. 


Aug 29, 2012 at 9:10 PM

You aren't using any of the actual switches.  Try something like:

E:ScriptSqlConfig.exe /s DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL"


That assumes that the EXEC is in the root directory of E:.

Aug 30, 2012 at 6:44 PM

Thanks that worked. I havent realized that /s was a switch,,,its not listed in the documentation...It did not work with my SQL Server Express Edition as it does not support it. What switch will script out all the database information, including SP's, tables, users, app roles, SQL Server Agent Jobs, etc???

Is it this:

E:ScriptSqlConfig.exe /s /databases DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL"

The EXEC is in the root directory of E. 

Thanks a lot once more and thanks a lot in advance for your help.

Best regards,


Aug 30, 2012 at 6:46 PM

In essence, I want the output of what it promises to do:

The following instance level objects are scripted:

  • Logins - These are scripted with the proper SID and the hashed password.
  • Jobs
  • Linked servers
  • Audits
  • Alerts
  • Credentials
  • Proxy Accounts
  • Database Mail

The following instance level objects and current values are written to a file:

  • Properties
  • Options

User objects in master, model and msdb are scripted.

The following user database objects can be scripted:

  • Tables
  • Stored procedures
  • User-defined data types
  • Views
  • Triggers
  • Table types
  • User-defined functions
  • Users, Database roles and application roles
Aug 31, 2012 at 9:57 AM

I execute the following: 

C:\Windows\system32>C:\Windows\system32>C:\Users\trommel\Downloads\ScriptSqlConfig.exe /s /dews0003/dir "C:\SQL"Launching (3.0.8)....Directory:

Does the following:

C:\SQLServer: /dews0003Scripting Instance information...

And get the following errors: (Tells me that is not able to connect to SQL Server) 

Unbehandelte Ausnahme: Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server . ---> System.Data.SqlClient.SqlException:Netzwerkbezogener oder instanzspezifischer Fehler beim Herstellen einer Verbindung mit SQL Server. Der Server wurde nicht gefunden, oder auf ihn kann nicht zugegriffen werden. Überprüfen Sie, ob der Instanzname richtig ist und ob SQL Server Remoteverbindungen zulässt. (provider: Named Pipes-Provider, error: 40 - Verbindung mit SQL Server konnte nicht geöffnet werden)   bei System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)   bei System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)   bei System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)   bei System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)   bei System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)   bei System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)   bei System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)   bei System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)   bei System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)   bei System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)   bei System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionowningObject)   bei System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)   bei System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)   bei System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)   bei System.Data.SqlClient.SqlConnection.Open()   bei Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect(WindowsIdentity impersonatedIdentity)   bei Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()   --- Ende der internen Ausnahmestapelüberwachung ---   bei Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()   bei Microsoft.SqlServer.Management.Common.ConnectionManager.PoolConnect()   bei Microsoft.SqlServer.Management.Common.ConnectionManager.get_DatabaseEngineType()   bei Microsoft.SqlServer.Management.Smo.Server.GetExecutionManager()   bei Microsoft.SqlServer.Management.Smo.Server.get_ExecutionManager()   bei Microsoft.SqlServer.Management.Smo.SqlSmoObject.get_ServerVersion()   bei Microsoft.SqlServer.Management.Smo.Server.GetPropertyMetadataProvider()   bei Microsoft.SqlServer.Management.Smo.SqlSmoObject.get_Properties()   bei Microsoft.SqlServer.Management.Smo.Server.get_VersionMajor()   bei ScriptSqlConfig.Program.GetTargetServerVersion(Server srv)   bei ScriptSqlConfig.Program.ScriptInstance(String server, String directory)   bei ScriptSqlConfig.Program.Main(String[] args)

Aug 31, 2012 at 3:34 PM

A couple of points.  First, if you are using EXPRESS you may need to download and install the SMO objects.  I'm afraid I won't be much help in getting that setup.  I haven't done any testing with this using EXPRESS.

Second, many of the command line options need values. For example, the /s needs to be followed by the name of the server.  So it looks like this:

E:ScriptSqlConfig.exe /s  DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL" /databases

You'll also need a space before and after each command line option and any value following it.


Aug 31, 2012 at 5:49 PM

thanks a lot...I appreciate your help and input. I have not tried it also with SQL Express only...I have a SQL Server 2012 Developer Instance on my local machine and it gives me authentication errors. The errors are listed above...its in German but all it says is that it cannot authenticate to SQL Server. So I did this:

E:ScriptSqlConfig.exe /s  DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL" /databases /sa /password1!

And it could not work.

Aug 31, 2012 at 6:30 PM

It doesn't support SQL Server 2012 yet.  

If you want to pass a username and password do this:

E:ScriptSqlConfig.exe /s  DEBEHQSQ03\SQLEXPRESS /dir "E:\SQL" /databases /user sa /password password1!

Please see the documentation for all the command line options:

Aug 31, 2012 at 6:31 PM

Thanks so have been so helpful! Very kind of you.

Aug 31, 2012 at 8:17 PM

Which editions of SQL Server does it support? I have all my instances running SQL Server 2008 R2. 

Apr 15, 2013 at 9:53 PM
Hello, I have a similar issue.

First of all - this is such a great tool and I am extremely pleased with its functionality and performance. Thank you so much for developing it and making it available!

So, I've got the Utility working on one server without any issues, but can't get it to work on another one.

Here is the error I get on the second machine:

Executed as user: XXXX\XXXXXXXXXX. Server: XXXXX\XXXX Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.SqlServer.Smo, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' at ScriptSqlConfig.Program.ScriptInstance(String server, String directory) at ScriptSqlConfig.Program.Main(String[] args) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Process Exit Code -532459699. The step failed._

I did notice that the Client Tools SDK was missing on the server, and I had it installed. But the error is still occurring.
What else could it be?
For instance, does .NET have to be installed on the server in order for the .exe to run?
Anything else I should check?

Please note: I do realize that I can simply point the utility to the server from another machine, which would (and does) work. However, the solution I'm trying to implement requires that the job runs locally. That is what I'm trying to accomplish.

Appreciate your help.

Apr 17, 2013 at 1:52 AM
It's looking for the SMO API for SQL Server 2012 and not finding it.

You do need .NET installed but I think you have it. Do you have the full SQL Server installed?
Apr 17, 2013 at 4:23 PM
Thanks a lot for your reply!

The issue was that there was also an instance of 2012 installed in TEST, but not in PROD. When downloading, I chose highest version. I then tested using it on all three (2005, 2008, 2012) in TEST, but once I moved to PROD the version of the Utility stopped working, since 2012 SMO was missing on the machine!
And I didn't realize that it was looking for 2012 until reading your post... Thanks for the clue/solution in your post it is now working with 2008 and 2005 - YAY!! :)

Thanks again, Bill - really appreciate the great job you've done with the project and your being so responsive!
Jul 29, 2013 at 10:31 PM
Hi, running into a problem with the utility. I created a scheduled job to run the utility against all my servers and create folders with scripts. It works great, mostly. But there is one issue - I get this error if (for instance) a server cannot be accessed or there is some other issue. The job then just stops until someone physically dismisses the message and then it continues.

Is there any way to set execution to "quite" mode so it doesn't raise errors and just goes through all servers in the list?

Utility is currently running on, against all kinds of versions of SQL.
Jul 30, 2013 at 11:58 AM
I'm pretty sure I didn't upload a debug instance by accident. You can always download the source and recompile :)

In the meantime, you can disable JIT:
Jul 30, 2013 at 1:31 PM
Unfortunately, I am not at all a developer so can't be trusted to fiddle with the code :)
But disable JIT I can do. Sounds like a logical option under the circumstances - thank you!