Hi ,
In my code I am replicating the Record link table from Nav to my database.
The Identity is set to true. Identity Management = Manual
I keep etting the error - "Cannot insert explicit value for identity column in table 'Record Link' when IDENTITY_INSERT is set to OFF. (Source: MSSQLServer, Error number: 544)"
when I try to replicate the Link Id column.
It has worked for most of my clients DB replication, only one database replication is missing some thing.
Can anyone please help ???
0
Comments
You are using column with identity and you are assigning some value to it (differen than 0)
You are not db_owner or you do not have other "higher" permissions
In this situation the system is trying to "change" the counter for the column to specified value, but you do not have permissions.
If you are replicating something from other table, I expect that you want to use the original value. Than you do not need to have the identity on the field. If you want to use the autoincrement, you need to not assign this field or assign 0 instead. The autoincrement will change it automatically.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
exec sp_addarticle @publication = N''' + @PUBLICATIONNAME + ''', @article = N''Record Link'', @source_owner = N''dbo'', @source_object = N''Record Link'', @type = N''logbased'', @description = N'''', @creation_script = N'''', @pre_creation_cmd = N''drop'', @schema_option = 0x000000000803509F, @identityrangemanagementoption = N''manual'', @destination_table = N''Record Link'', @destination_owner = N''dbo'', @status = 24, @vertical_partition = N''true'', @ins_cmd = N''CALL [dbo].[sp_MSins_dboRecord Link]'', @del_cmd = N''CALL [dbo].[sp_MSdel_dboRecord Link]'', @upd_cmd = N''SCALL [dbo].[sp_MSupd_dboRecord Link]'';
';
/* Adding the article's partition column(s) */
SET @SQL = @SQL + '
exec sp_articlecolumn @publication = N''' + @PUBLICATIONNAME + ''', @article = N''Record Link'', @column = N''timestamp'', @operation = N''add'', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1;
exec sp_articlecolumn @publication = N''' + @PUBLICATIONNAME + ''', @article = N''Record Link'', @column = N''Link ID'', @operation = N''add'', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1;
exec sp_articlecolumn @publication = N''' + @PUBLICATIONNAME + ''', @article = N''Record Link'', @column = N''Company'', @operation = N''add'', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1;
SET @SQL = @SQL + '
exec sp_articleview @publication = N''' + @PUBLICATIONNAME + ''', @article = N''Record Link'', @view_name = N''SYNC_Record Link_1__73'', @filter_clause = N'''', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1;[/color][/color][/color]
The TSQL set identity OFF does not works as, then next time table is replicated it has the definition of having identity set to true.
how can i set the identity false in the replicated table ?? The Nav table has Id as identity=true.
How can I make it a non identity in the subscriber????
what do you mean by creating the table manually.
The next time I generate a new snapshot, it will delete the table and copy the definition of id field from the Nav database i.e. the publisher.
Please correct me if I am wrong and explain .
FD Consulting