May 6, 2005 at 10:57 am
I rarely right procedures as I typically provide adhoc T-SQL support. However, that is changing and I am designing more databases, etc. I have been looking for a quick reference on transactions but haven't found one. I'm hoping some people on the list might look at the following procedure and provide suggestions on transaction management. In this procedure, the deletes have to happen in the order I've listem them as there are DRI requirements.
CREATE PROCEDURE dbo.spDeleteLandSites
(@SiteID uniqueidentifier)
AS
SET NOCOUNT ON
BEGIN
DELETE FROM dbo.LandSiteImages WHERE SiteID=@SiteID
DELETE FROM dbo.LandSiteDescriptions WHERE SiteID=@SiteID
DELETE FROM dbo.LandSites WHERE SiteID=@SiteID
END
Thanks in advance. RH
GO
May 6, 2005 at 11:05 am
There is a series of articles on this site that provide a good overview of transactions (and performing error checking, rollbacks, etc. inside them). See: http://www.sqlservercentral.com/columnists/dpeterson/allabouttransactionspart1.asp
http://www.sqlservercentral.com/columnists/dpeterson/allabouttransactionspart2.asp
http://www.sqlservercentral.com/columnists/dpeterson/allabouttransactionspart3.asp
May 6, 2005 at 11:08 am
Thanks. RH
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply