Je suis en train de faire une sauvegarde pour mes données de mon premier DocumentManagement.tbDocumentsHistory de table et l'enregistrer sur DocumentManagement.tbDocumentsUne valeur explicite pour la colonne d'identité?
et parce que les DocumentManagement.tbDocuments ont ID colonne IDENTITY_INSERT cette erreur élevée
Une valeur explicite pour la colonne d'identité dans la table 'DocumentManagement.tbDocuments' ne peut être spécifiée que lorsqu'une liste de colonnes est utilisée et IDENTITY_INSERT sur ON.
quand je le code
DELETE FROM DocumentManagement.tbDocumentsHistory
OUTPUT DELETED.* INTO DocumentManagement.tbDocuments
FROM DocumentManagement.tbDocumentsHistory
WHERE [email protected]
J'ai essayé de désactiver le identity_insert DocumentManagement.tbDocuments en utilisant ce code
SET IDENTITY_INSERT DocumentManagement.tbDocuments ON
DELETE FROM DocumentManagement.tbDocumentsHistory
OUTPUT DELETED.* INTO DocumentManagement.tbDocuments
FROM DocumentManagement.tbDocumentsHistory
WHERE [email protected]
SET IDENTITY_INSERT DocumentManagement.tbDocuments OFF
et je suis face à toujours la même erreur!
mes tables desc:
CREATE TABLE [DocumentManagement].[tbDocuments](
[DocumentID] [bigint] IDENTITY(1,1) NOT NULL,
[DocumentNameEn] [nvarchar](max) NULL,
[DocumentNameAr] [nvarchar](max) NULL,
[DocumentDescriptionEn] [nvarchar](max) NULL,
[DocumentDescriptionAr] [nvarchar](max) NULL,
[CreatedOn] [datetime2](7) NULL,
[ModifiedOn] [datetime2](7) NULL,
[AddedBy] [bigint] NULL,
[modifaiedBy] [bigint] NULL,
[PhysicalName] [nvarchar](max) NULL,
[Extension] [nvarchar](15) NULL,
[DocumentTypeID] [bigint] NULL,
[PhysicalPath] [nvarchar](max) NULL,
CONSTRAINT [PK_tbDocuments] PRIMARY KEY CLUSTERED([DocumentID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) SUR [PRINCIPAL]
CREATE TABLE [DocumentManagement].[tbDocumentsHistory](
[DocumentID] [bigint] NOT NULL,
[DocumentNameEn] [nvarchar](max) NULL,
[DocumentNameAr] [nvarchar](max) NULL,
[DocumentDescriptionEn] [nvarchar](max) NULL,
[DocumentDescriptionAr] [nvarchar](max) NULL,
[CreatedOn] [datetime2](7) NULL,
[ModifiedOn] [datetime2](7) NULL,
[AddedBy] [bigint] NULL,
[modifaiedBy] [bigint] NULL,
[PhysicalName] [nvarchar](max) NULL,
[Extension] [nvarchar](15) NULL,
[DocumentTypeID] [bigint] NULL,
[PhysicalPath] [nvarchar](max) NULL, CONSTRAINT [PK_tbDocumentsHistory] PRIMARY KEY CLUSTERED([DocumentID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
nvarchar (max) pour un nom de document. Sérieusement? –
c'est juste un test de données !! – HAJJAJ