2 Eylül 2008 Salı

"Msg 14684, Level 14, State 1, Procedure sp_syscollector_create_collection_set, Line 203

HATA MESAJI:
"Msg 14684, Level 14, State 1, Procedure sp_syscollector_create_collection_set, Line 203

Caught error#: 2627, Level: 14, State: 1, in Procedure: sp_syscollector_create_collection_set, Line: 137, with Message: Violation of UNIQUE KEY constraint 'UQ_syscollector_collection_sets_internal_name'. Cannot insert duplicate key in object 'dbo.syscollector_collection_sets_internal'."

AÇIKLAMA:
SQL Server 2008' de, "sp_syscollector_create_collection_set" Stored Procedure' ını kullanarak bir Collection Set oluşturmak istediğinizde böyle bir hata ile karşılaşabilirsiniz.

Bunun nedeni, oluşturmaya çalıştığınız Collection Set ile aynı ada sahip olan ve zaten oluşturulmuş bir Collection Set' in bulunmasıdır.

ÇÖZÜM:
Collection Set oluşturma örneği:

USE msdb
GO
DECLARE @mycollection_set_id int
DECLARE @mycollection_set_uid UNIQUEIDENTIFIER
EXEC [dbo].[sp_syscollector_create_collection_set]
@name=N'BaziBilgiler',
@collection_mode=1,
@description=N'... ... hakkında bilgi toplama',
@target=N'',
@logging_level=1,
@days_until_expiration=90,
@proxy_name=N'',
@schedule_name=N'CollectorSchedule_Every_6h',
@collection_set_id=@mycollection_set_id OUTPUT,
@collection_set_uid=@mycollection_set_uid OUTPUT

Bu hatayı almamak için, bu örnekteki @Name isimli parametrede kullandığınız değeri değiştirmeniz yeterli olacaktır.

Hiç yorum yok: