I'm searching for help Situation is the fact that I've 2 databases that ought to be identical in structure other than the brand new push dbs has ident posts, PK and fk contraints defined. I must consolidate 4 slightly different dbs in a single 'TempDB' then copy the information in to the 'NewProddb'.
I've handled a script lto switch off FK inspections, and switch on FK inspections, therefore the place must look something similar to this
[Script to disable all FK Constraints (nocheck)]
SET IDENTITY_INSERT [NewProdDB].[dbo].[Event] ON; INSERT INTO [dbo].[Event] (EventID, Name, StartDate, EndDate, PartnerRegStartDate, PartnerRegEndDate, HouseholdRegStartDate, HouseholdRegEndDate, ChannelId, HasTeam, MaxteamMembers) (Select EventID, Name, StartDate, EndDate, PartnerRegStartDate, PartnerRegEndDate, HouseholdRegStartDate, HouseholdRegEndDate, ChannelId, HasTeam, MaxteamMembers From TempDB.dbo.Event); SET IDENTITY_INSERT [NewProdDb].dbo.[Event] OFF;
[Script make it possible for all FK Constraints (check)]
What I wish to do would be to script this all at once instead of writing a script for the tables individually. ALl Data in most Posts will be replicated.
I really hope this really is obvious.
Thanks ahead of time.
I'll attempt to answer when it comes to Oracle db, you'll find counterparts in MSSQL.
You will find system tables which store tables &lifier posts information. So that your script can perform the next
- Pass source schema &lifier target schema
- Load tables &lifier corresponding posts having a join between ALL_TABLES &lifier ALL_TAB_Posts for that source schema. Loop the outcomes &lifier generate your place scripts. You are able to write it to sql file &lifier then execute.