When executed the following script to archive Catalog data, we execute the script it generates the following error appears and the archive fails.
Code example:
USE [mdb]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[usm_sp_archive_data]
@p_object_type = N'< Request >',
@p_date = N'< 2015-01-01 >',
@p_bu = N'< Broadcom >'
SELECT 'Return Value' = @return_value
GO
Error:
Msg 8114, Level 16, State 5, Procedure usm_sp_archive_data, Line 0 [Batch Start Line 2]
Error converting data type nvarchar to datetime.
Release : 17.3
The error is caused by the carets (< >) on the date @p_date variable. Please remove them from the script and run it again.
e.g.
USE [mdb]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[usm_sp_archive_data]
@p_object_type = N'Request',
@p_date = N'2015-01-01',
@p_bu = N'Broadcom'
SELECT 'Return Value' = @return_value
GO