Where is stored the 'NOT FOR REPLICATION' BIT
I am scripting out the foreign keys for a SQL Server database, and so far I have been able to find all the pertinent information to add a foreign key to the table. The only piece of code that is missing is开发者_开发百科 the 'NOT FOR REPLICATION' (see below) Does anyone know where does this piece of information live?
ALTER TABLE [dbo].[Accountxxxx] WITH NOCHECK ADD
CONSTRAINT [FK_Accountxxxx_Accountxxxx_zzzz]
FOREIGN KEY([D_XX_Guid])
REFERENCES [dbo].[second_table_name] ([Guid])
NOT FOR REPLICATION
Thanks, E.
sys.foreign_keys
contains that information in a fairly straightforward fashion:
is_not_for_replication bit FOREIGN KEY constraint was created by using the NOT FOR REPLICATION option.
If that's not what you're after, perhaps you can elaborate on how you're doing your scripting (SSMS should be scripting this option as appropriate).
精彩评论