0
我是新來的SQL,我想用ROLLBACK TRANSACTION在SQL所以我這樣做SQL事務
--to insert into instructor table--
create procedure [dbo].[insertInstructor] (@f_name varchar(50), @l_name varchar(50), @contact nvarchar(50))
AS
BEGIN
begin transaction
save transaction insert_instructor
insert into instructor(f_name,l_name,contact)
values(@f_name,@l_name,@contact)
END
--to rollback the transaction i did this
create procedure [dbo].[delete_instructor]
AS
BEGIN
begin transaction insert_instructor
rollback transaction insert_instructor
END
我叫我的窗口,這些存儲過程中形成的應用C#。 TIA
你的問題是? – Xedni
是對還是不是?因爲它不工作在我的Windows窗體應用程序 – Faiq
閱讀如何提出問題https://stackoverflow.com/help/how-to-ask和事務https://docs.microsoft.com/en-us/sql/t -sql/language-elements/transactions-transact-sql – Eric