February 12, 2007 at 2:41 am
Hi Guys,
I have the following stored proc:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp__TNGAlert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp__TNGAlert]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE proc [dbo].[sp__TNGAlert]
@JobName NVARCHAR(4000),
@alert VARCHAR(50)
as
SET NOCOUNT ON
--
DECLARE @AlertDir NVARCHAR(4000)
DECLARE @ServerName VARCHAR(50)
DECLARE @FailureDate VARCHAR(50)
DECLARE @Error NVARCHAR(4000)
DECLARE @cmd SYSNAME
--
SET @AlertDir = ' >> \\BEPSQL01\SQLG\TNGLog\Alerts.txt'
SET @ServerName = @@ServerName
SET @FailureDate = (select getdate())
SET @Error = @ServerName + ' - ' + @JobName + ' ' + @alert + ' on ' + @FailureDate + @AlertDir
SET @cmd = 'echo ' + @error
--
EXEC master.dbo.xp_cmdshell @cmd
--
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
When I execute the script(EXEC sp__TNGAlert 'Backup System Database','Test Failure') in query analyzer it gives me the following error:
Logon Failure: Unknown user name or bad password
Can anyone pls help me on this?
Regards
February 12, 2007 at 4:58 am
does the account running the sql server have access to the share mentioned. If not then give access to that share and check if the proc runs fine.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
February 12, 2007 at 5:09 am
the problem has been solved, my team leader informed me that the startup parameters where set to local and this had to be handed over to the NT engineers, i can't do anything about it on my side.
Regards;
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply