views:

44

answers:

0

Hello all,

I have a PHP script that queries SQL server using SQLCMD - I am using SQL Server Express 2008.

Most of my queries go through to SQL Server fine but sometimes I get this:

sqlcmd return output is: Array
(
    [0] => Msg 4060, Level 11, State 1, Server ABS-PC\SQLEXPRESS, Line 1
    [1] => Cannot open database "test_v02" requested by the login. The login failed.
    [2] => Msg 18456, Level 14, State 1, Server ABS-PC\SQLEXPRESS, Line 1
    [3] => Login failed for user 'NT AUTHORITY\SYSTEM'.
)

The above appears in my log file and it says the above when my scripts have just previously executed a query (seconds ago) and a few lines down my log file I see that its executed other queries fine. I am sure its nothing to do with the queries itself but why is it not able to get access sometimes and other times it gets access?

I would appreciate anyone to shed some light on this.

Thanks all