Yang pernah/sedang mengalami gagal simpan schema pada Microsoft SQLServer 2012, dengan pesan error kurang lebih seperti ini:

TITLE: Microsoft SQL Server Management Studio Cannot insert the value NULL into column 'diagram_id', table 'DBNAME_ALS.dbo.sysdiagrams'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The 'sp_creatediagram' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead. (.Net SqlClient Data Provider)

Berikut solusi untuk mengobatinya:

DROP TABLE dbo.sysdiagrams;
GO

CREATE TABLE [dbo].[sysdiagrams]
     (
      [name] [sysname] NOT NULL,
      [principal_id] [int] NOT NULL,
      [diagram_id] [int] IDENTITY(1,1) PRIMARY KEY,
      [version] [int] NULL,
      [definition] varbinary NULL,
      CONSTRAINT [UK_principal_name] UNIQUE ([principal_id],[name])
     );
GO

EXEC sys.sp_addextendedproperty 
      @name=N'microsoft_database_tools_support', 
      @value=1 , 
      @level0type=N'SCHEMA',
      @level0name=N'dbo', 
      @level1type=N'TABLE',
      @level1name=N'sysdiagrams';
GO

Semoga bermanfaat.

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *