Link to home
Start Free TrialLog in
Avatar of LIULIHUA
LIULIHUA

asked on

Cannot add rows to sysdepends for the current stored procedure

Hi experts,

Is anyone knows what the probolm of this scripts ? It won't executing because "Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'usp_copy'. The stored procedure will still be created."
Please advice. thanks.

/***Copy files***/
USE MASTER
IF OBJECT_ID ('dbo.usp_copy') IS NOT NULL
DROP PROC dbo.usp_copy
GO

CREATE PROCEDURE USP_COPY AS

DECLARE @cmd VARCHAR(5000)
SET @cmd = 'mkdir c:\data\WeeklyData_'+ REPLACE(CONVERT(varchar(11),GETDATE(),100),' ','')
exec master..xp_cmdshell @cmd
set @cmd = 'copy c:\data\FTP_DOWNLOAD\*.zip c:\data\WeeklyData_'+ REPLACE(CONVERT(varchar(11),GETDATE(),100),' ','')
exec master..xp_cmdshell @cmd
set @cmd = 'copy c:\data\FTP_DOWNLOAD\*.Z c:\data\WeeklyData_'+ REPLACE(CONVERT(varchar(11),GETDATE(),100),' ','')
exec master..xp_cmdshell @cmd

EXEC usp_copy
GO
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LIULIHUA
LIULIHUA

ASKER

Thank you angelIII,

When I call the precedure outside the procedure works, the folder is created and all the files are copied, EXCEPTE it goes loop, the procedure goes nonstop.....
Hi,

The problem has been solved, just sapareated each of the command line as a singal sp. thanks.