Hi,
I have write one stored proc which will multiple stored proc based on the dependencies of tables
to check that the root tables are filled first and then to fill reference tables.
Thank you
Hi,
I have write one stored proc which will multiple stored proc based on the dependencies of tables
to check that the root tables are filled first and then to fill reference tables.
Thank you
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Srinivasan RamamoorthiPosted Oct 7, 2021, 5:35 AM
Srinivasan RamamoorthiPosted Oct 7, 2021, 11:47 AM
Try the below scripts in Stored procedure. Ensure SP has permission to enable/disable constraints
-- Disable all table constraints
ALTER TABLE TableName NOCHECK CONSTRAINT ALL
-- Enable all table constraints
ALTER TABLE TableName CHECK CONSTRAINT ALL
-- ----------
-- Disable single constraint
ALTER TABLE TableName NOCHECK CONSTRAINT Constraint Name
-- Enable single constraint
ALTER TABLE TableName CHECK CONSTRAINT Constraint Name
jayu pPosted Oct 7, 2021, 11:39 AM
Periyasamy VellingirisamyPosted Oct 7, 2021, 5:06 AM
jayu pPosted Oct 7, 2021, 3:59 AM
Hi SrinivasanI am creating a data model, where I have to import data from staging tables to final table in different schema within same database.To achieve this dynamically I am going to write procedure for each table to import data Each table is dependent on other and while importing I have check the dependencies of tables so that each root tables are filled if no check done then importing data will fail.I have to do this by sql only Thank you
Srinivasan RamamoorthiPosted Oct 6, 2021, 4:51 PM