mattv10
03-15-2007, 11:11 AM
Hi everyone,
I need to Update multiple tables in my database. I searched around and learned that you had to create a store proc and use BEGIN TRANSACTION and COMMIT to complete this.. However, I was unable to find a clear example for what I want..
I wrote something.... Its probably not fully correct because this would be my first stored proc I ever wrote in SQL...
First what I need to know is if this stored proc will work with my ASP page and MS Access?
Here is my stored proc...
CREATE PROC updateObjTypes
BEGIN TRANSACTION
UPDATE RDEObjTypeMstr SET RDEObjType = @uObjType, RDEObjTypeCd = @uObjCd, DescText = @uDesc, Status = @uAStats, LastCngDTime = @uDate, LastCngUser = @uUser
WHERE RDEObjTypeId = @ObjID
UPDATE RDEObjActionTypeMstr Set RDEObjTypeCdAssoc = @uObjCd
UPDATE RDEAbendTypeMstr Set RDEObjTypeCd = @uObjCd
COMMIT
I have not tried this yet because I want to make sure syntactically I am on the write track before I work with my logic. So, if anyone could assist me on this I would appreciate it.
Thanks in advance!
I need to Update multiple tables in my database. I searched around and learned that you had to create a store proc and use BEGIN TRANSACTION and COMMIT to complete this.. However, I was unable to find a clear example for what I want..
I wrote something.... Its probably not fully correct because this would be my first stored proc I ever wrote in SQL...
First what I need to know is if this stored proc will work with my ASP page and MS Access?
Here is my stored proc...
CREATE PROC updateObjTypes
BEGIN TRANSACTION
UPDATE RDEObjTypeMstr SET RDEObjType = @uObjType, RDEObjTypeCd = @uObjCd, DescText = @uDesc, Status = @uAStats, LastCngDTime = @uDate, LastCngUser = @uUser
WHERE RDEObjTypeId = @ObjID
UPDATE RDEObjActionTypeMstr Set RDEObjTypeCdAssoc = @uObjCd
UPDATE RDEAbendTypeMstr Set RDEObjTypeCd = @uObjCd
COMMIT
I have not tried this yet because I want to make sure syntactically I am on the write track before I work with my logic. So, if anyone could assist me on this I would appreciate it.
Thanks in advance!