SQLConnection Exception occurrence while DDL Script generation

I see a login failure exception when I try to generate DDL script on the objects in my SQL Sever database. I am able to connect to the database with 'testuser' and run queries against the tables in the database. Please find stacktrace for the exception occurred below.

I am able to login to the database with the same user both using Toad for SQL Server and SSMS.

Any help to resolve this problem is highly appreciated.

Thanks!

System.Data.SqlClient.SqlException
Login failed for user 'testuser'.
Stack Trace:
at Quest.Shared.MSSQL.SQLConnOptions.GetOpenSqlConnection(ISQLConnOptions conn, Boolean defaultConnection)
at Quest.Shared.MSSQL.SQLConnOptions.<.ctor>b__1()
at Quest.Shared.Memorizing.ThreadSafeObjectHolder1.Initialize() at Quest.Schema.MSSQL.ComparePlugin.ObjectSearch.TargetsController.control_ConnectionChanged(Object sender, EventArgs e) at Quest.Schema.Common.ComparePlugin.Controls.SchemasSelectionComboBoxControl.OnConnectionChanged(Object sender, EventArgs e) at Quest.Schema.Common.ComparePlugin.Controls.DatabasesSelectionCheckedListController.OnConnectionChanged() at Quest.Schema.Common.ComparePlugin.Controls.DatabasesSelectionCheckedListController.InitializeConnection(IConnection connection, List1 selectedSchemas)
at Quest.Schema.Common.ComparePlugin.Controls.SchemasSelectionComboBoxControl.InitializeConnection(IConnection connection, List`1 selectSchemas)
at Quest.Schema.Common.ComparePlugin.ObjectsSearch.GenerateDDLScriptDocument.document_ConnectionChanged(Object sender, ConnectionEventArgs e)
at Quest.Schema.Common.ComparePlugin.ObjectsSearch.GenerateDDLScriptDocument.CreateDocument(ITrl trls)

System.Data.SqlClient.SqlException
Login failed for user 'testuser'.
Stack Trace:
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Quest.Shared.MSSQL.SQLConnOptions.GetOpenSqlConnection(ISQLConnOptions conn, Boolean defaultConnection)

Hi Bhanu,
which Toad version and which DB version is it?
Are there any specific settings for the connection?

Hello Dan,

Toad version : 6.8.1.204 (64 bit)

DB version : SQL Server 2014

There are no specific settings for the connection. It uses SQL server authentication. I am able to connect to the database and run queries against the tables
and execute stored procedures, but not able to generate DDL, DML and data scripts from the database.

Please let me know if you need any more information.

Hi Bhanu,

Do you save password to connection? DDL Scripting uses different connection than main Toad window

Hi Vasiliy,

Yes. I save password to connection.

Does 'testuser' has access to master db? For read list of available databases

Do you tried another user?

Hi Vasiliy,

Yes. This testuser has access to master db.

I don’t have permissions to try with another user because it is shared database server managed by a DBA team.

Hi Bhanu,
it'd be best if you opened up a support ticket at support.quest.com so you can send us some files and more info. Thanks

Thank you Daniel.