Fail to archive Service Catalog data
search cancel

Fail to archive Service Catalog data

book

Article ID: 267535

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

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.

 

 

Environment

Release : 17.3

Resolution

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

Additional Information

Archive and Purge Historical Data