To resolve the issue, follow these steps:
- Run the following script to change the tables of predefined database objects:
/******************************************************************************************************************
** Copyright (c) 2018 Microsoft Corporation.
** All Rights Reserved
******************************************************************************************************************/
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[SchemaChanges]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
BEGIN
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_PackageInformation_HOST_ID]') AND OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PackageInformation] DROP CONSTRAINT [FK_PackageInformation_HOST_ID]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[IX_PackageInformation_2]'))
ALTER TABLE [dbo].[PackageInformation] DROP CONSTRAINT [IX_PackageInformation_2]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[DF_PackageInformation_percent_cached]'))
ALTER TABLE [dbo].[PackageInformation] DROP CONSTRAINT [DF_PackageInformation_percent_cached]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[DF_ApplicationUsage_shutdown_state]'))
ALTER TABLE [dbo].[ApplicationUsage] DROP CONSTRAINT [DF_ApplicationUsage_shutdown_state]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[CK_ApplicationUsage_shutdown_state]'))
ALTER TABLE [dbo].[ApplicationUsage] DROP CONSTRAINT [CK_ApplicationUsage_shutdown_state]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[CK_ApplicationUsage_start_time_LEQ_end_time_MULTIFIELD]'))
ALTER TABLE [dbo].[ApplicationUsage] DROP CONSTRAINT [CK_ApplicationUsage_start_time_LEQ_end_time_MULTIFIELD]
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[UK_ApplicationUsage_1]'))
ALTER TABLE [dbo].[ApplicationUsage] DROP CONSTRAINT [UK_ApplicationUsage_1]
IF EXISTS (SELECT name FROM sysindexes WHERE name = 'IX_ApplicationUsage_2')
DROP INDEX [ApplicationUsage].[IX_ApplicationUsage_2]
IF EXISTS (SELECT name FROM sysindexes WHERE name = 'IX_ApplicationUsage_3')
DROP INDEX [ApplicationUsage].[IX_ApplicationUsage_3]
IF EXISTS (SELECT name FROM sysindexes WHERE name = 'IX_ApplicationUsage_4')
DROP INDEX [ApplicationUsage].[IX_ApplicationUsage_4]
ALTER TABLE [dbo].[UnprocessedCompletedApplicationUsage] ALTER COLUMN [app_name] [nvarchar] (1024) COLLATE database_default NULL
ALTER TABLE [dbo].[ApplicationUsage] ALTER COLUMN [app_name] [nvarchar] (1024) COLLATE database_default NULL
ALTER TABLE [dbo].[UnprocessedCurrentApplicationUsage] ALTER COLUMN [app_name] [nvarchar] (1024) COLLATE database_default NULL
IF COL_LENGTH('ApplicationUsage','shutdown_state') IS NOT NULL
ALTER TABLE [dbo].[ApplicationUsage] DROP COLUMN [shutdown_state]
END
END
GO
- Run the built-in SQL scripts to refresh the “View” database objects:
%ProgramFiles%\Microsoft Application Virtualization Server\Scripts\Reporting\CreateViews.sql
- Run the built-in SQL script to refresh the “Programmability” database objects:
%ProgramFiles%\Microsoft Application Virtualization Server\Scripts\Reporting\CreateReportingStoredProcs.sql
After you complete these steps, the App_name column will be enlarged to accommodate long application names.