{"id":12113,"date":"2024-01-02T14:09:53","date_gmt":"2024-01-02T13:09:53","guid":{"rendered":"https:\/\/sdna.lu\/?p=12113"},"modified":"2024-01-02T14:27:09","modified_gmt":"2024-01-02T13:27:09","slug":"delete-queries-to-create-a-standard-database","status":"publish","type":"post","link":"https:\/\/sdna.lu\/?p=12113","title":{"rendered":"Delete queries to create a standard database"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Declare @DBId int = 34<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Delete from [Address] where [DBId] = @DBId;<br>Delete from [Article] where [DBId] = @DBId;<br>Delete from [ArticlePrice] where [DBId] = @DBId;<br>Delete from [ArticleSupplier] where [DBId] = @DBId;<br>Delete from [ArticleType] where [DBId] = @DBId;<br>Delete from [Bank] where [DBId] = @DBId;<br>Delete from [BankAccount] where [DBId] = @DBId;<br>Delete from [Capital] where [DBId] = @DBId;<br>Delete from [Client] where [DBId] = @DBId and not CompanyId = 1<br>Delete from [Company] where [DBId] = @DBId and not Id = 1<br>Delete from [CompanyGroup] where [DBId] = @DBId;<br>Delete from [CompanyType] where [DBId] = @DBId;<br>Delete from [CompanyDetail] where [DBId] = @DBId and not CompanyId = 1<br>Delete from [CompPersBankAccount] where [DBId] = @DBId;<br>Delete from [Contract] where [DBId] = @DBId;<br>Delete from [ContractProvision] where [DBId] = @DBId;<br>Delete from [ContractCategory] where [DBId] = @DBId;<br>Delete from [ContractClaim] where [DBId] = @DBId;<br>Delete from [ContractCause] where [DBId] = @DBId;<br>Delete from [ContractDetail] where [DBId] = @DBId;<br>Delete from [ContractPremiumRegul] where [DBId] = @DBId;<br>Delete from [ContractCoInsurer] where [DBId] = @DBId;<br>Delete from [CountryIndexType] where [DBId] = @DBId;<br>Delete from [Division] where [DBId] = @DBId;<br>Delete from [Document] where [DBId] = @DBId;<br>Delete from [EmailAddress] where [DBId] = @DBId;<br>Delete from [GLAccountCur] where [DBId] = @DBId;<br>Delete from [GLBankStatment] where [DBId] = @DBId;<br>Delete from [GLMovement] where [DBId] = @DBId;<br>Delete from [GLMovementOld] where [DBId] = @DBId;<br>Delete from [GLPeriod] where [DBId] = @DBId;<br>Delete from [GLPeriodUser] where [DBId] = @DBId;<br>Delete from [GLYEBalance] where [DBId] = @DBId;<br>Delete from [Holiday] where [DBId] = @DBId;<br>Delete from [InvoiceT] where [DBId] = @DBId;<br>Delete from [InvoiceTDetail] where [DBId] = @DBId;<br>Delete from [InvoiceF] where [DBId] = @DBId;<br>Delete from [InvoiceFDetail] where [DBId] = @DBId;<br>Delete from [InvoicePayment] where [DBId] = @DBId;<br>Delete from [Job] where [DBId] = @DBId and not Id = 1<br>Delete from [KYC] where [DBId] = @DBId;<br>Delete from [Person] where [DBId] = @DBId;<br>Delete from [PersonDetail] where [DBId] = @DBId;<br>Delete from [Phone] where [DBId] = @DBId;<br>Delete from [Relation] where [DBId] = @DBId;<br>Delete from [SecurityType] where [DBId] = @DBId;<br>Delete from [SPeriod] where [DBId] = @DBId;<br>Delete from [Stock] where [DBId] = @DBId;<br>Delete from [StockExchange] where [DBId] = @DBId;<br>Delete from [StockTransfer] where [DBId] = @DBId;<br>Delete from [Supplier] where [DBId] = @DBId and not CompanyId = 1<br>Delete from [TPeriod] where [DBId] = @DBId;<br>Delete from [Translog] where [DBId] = @DBId;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Declare @DBId int = 34 Delete from [Address] where [DBId] = @DBId;Delete from [Article] where [DBId] = @DBId;Delete from [ArticlePrice] where [DBId] = @DBId;Delete from [ArticleSupplier] where [DBId] = @DBId;Delete from [ArticleType] where [DBId] = @DBId;Delete from [Bank] where [DBId] = @DBId;Delete from [BankAccount] where [DBId] = @DBId;Delete from [Capital] where [DBId] = @DBId;Delete from [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12113","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/12113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12113"}],"version-history":[{"count":4,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/12113\/revisions"}],"predecessor-version":[{"id":12121,"href":"https:\/\/sdna.lu\/index.php?rest_route=\/wp\/v2\/posts\/12113\/revisions\/12121"}],"wp:attachment":[{"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdna.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}