Showing posts with label resolve. Show all posts
Showing posts with label resolve. Show all posts

Friday, March 23, 2012

Login failed for user '(null)'

I get the following error in the SQL Logs.

What does this error mean and how can I resolve this?

18452 :
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Se
rver connection.

Thanks

Santhosh

Some client tries to login to SQL Server without passing the WIndows credentials.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

How can I resolve this?

The scenario is... We use a third party backup software. This backup software uses SQL as its database to store session records. Whenever, the tape engine starts it logs on the above message and also during the backups it logs on the above message.

While configuring SQL to be as the backup software's database, there is a option to enter SQL Security. When we enter SA as security, we do not get this error. When we use windows security, we get this error.

Any help is appreciated.

Thanks

Santhosh

|||

Check the KBAs

http://support.microsoft.com/kb/265808

http://support.microsoft.com/kb/555332

And http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx if its a SQL 2005 box.

As suggested you have to check and configure the SQL Server authentication to allow this backup software to connect to database.

|||

Is the backup software running on the same machine as SQL Server? If not, are the machines in the same domain?

Thanks
Laurentiu

sql

Login failed for user (null)

Any users out there resolve this one. Thanks in advance!

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.OleDb.OleDbException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[OleDbException (0x80004005): Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1054593
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

Did you use Windows Authentication to connect the SQL instance? The error message indicates that the SQL instance doesn't 'know' the login. You can try to add the login to the SQL instance as following:

1. Open SQL Server Management Studio

2. Go to the instance, explore 'Security'->rigth click 'Login'->'New login...', just add the account that you used to connect

Wednesday, March 7, 2012

logical inserted table and after triggers

for some reason my create trigger query fails because sql server cannot resolve the term inserted. It won't even parse without errors. This is what my t-sql looks like

CREATE TRIGGER UserTypeTrig ON GTData.dbo.GTUserType

AFTER Insert, Update

AS

SET NOCOUNT ON

IF EXISTS(SELECT *

FROM GTData.dbo.GTUserType G

JOIN INSERTED I

ON G.TypeID != I.TypeID AND LOWER(G.UserType) = LOWER(I.UserType);

BEGIN;

RAISERROR('cannot insert duplicate userType', 16, 1)

ROLLBACK TRANSACTION

RETURN

END;

appreciate all the help i can get.

Your syntax is not correct. You are using statement terminators in the wrong place. See the modified code:

CREATE TRIGGER UserTypeTrig ON GTData.dbo.GTUserType

AFTER Insert, Update

AS

SET NOCOUNT ON;

IF EXISTS(SELECT *

FROM GTData.dbo.GTUserType G

JOIN INSERTED I

ON G.TypeID != I.TypeID AND LOWER(G.UserType) = LOWER(I.UserType)

)

BEGIN;

RAISERROR('cannot insert duplicate userType', 16, 1);

ROLLBACK TRANSACTION;

RETURN;

END;

|||

Umachandar Jayachandran

Thanks a lot!