Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 delete query with transaction and rollback

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2010-07-11 : 10:49:28
Hi All.
I would like create delete query to delete, for instance, EmployeeID from some tables if it exists. And rollback if delete event was wrong. If it possible how it to do explain.
Thanks.

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-07-11 : 14:54:54
when you say delete EmployeeID from some tables, you mean from one table or from many tables?

and how do you define that "delete event was wrong"?
Go to Top of Page

jessiefun
Starting Member

35 Posts

Posted - 2010-07-12 : 01:58:00
I really don't get it.....:S
Go to Top of Page

SD_Monkey
Starting Member

38 Posts

Posted - 2010-07-12 : 02:14:00
YUP.. you can do that on trigger on Stored Procedure

you need to have some validation to verify that the data is true otherwise
it will rollback...

this might give you some info about trigger...
http://www.devarticles.com/c/a/SQL-Server/Using-Triggers-In-MS-SQL-Server/

this is on stored procedure
http://databases.about.com/od/sqlserver/a/storedprocedure.htm




A maze make you much more better
Go to Top of Page
   

- Advertisement -