Created
January 11, 2016 09:55
-
-
Save jamescoxhead/8588d9442a2ddb765e82 to your computer and use it in GitHub Desktop.
Hard deletes a uCommerce product. When a product is deleted from the back office it is only soft deleted, there is no way to hard-delete a product from the back office.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION | |
BEGIN TRY | |
DECLARE @ProductId int; | |
SET @ProductId = 142; | |
DELETE FROM uCommerce_PriceGroupPrice | |
where ProductId = @ProductId | |
DELETE FROM uCommerce_ProductRelation | |
where ProductId = @ProductId | |
DELETE FROM uCommerce_CategoryProductRelation | |
where ProductId = @ProductId | |
DELETE FROM uCommerce_ProductProperty | |
where ProductId = @ProductId | |
DELETE FROM uCommerce_ProductDescription | |
where ProductId = @ProductId | |
DELETE FROM uCommerce_Product | |
where ProductId = @ProductId | |
END TRY | |
BEGIN CATCH | |
ROLLBACK TRANSACTION | |
END CATCH | |
IF @@TRANCOUNT > 0 | |
COMMIT TRANSACTION | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment