SQL语句示列
(1)
declare @TempID int
Begin
insert into TBL_HOUSEHEEPING_ITEM_DETAILS(Details_Name)values('dd')
set @TempID =@@identity
insert into TBL_TYPE (Type_Name)values(@TempID)
end
(2)
declare @TempID int
declare @cc varchar(20)
SELECT @cc='True'
DECLARE @Status int
SELECT @Status = CASE @cc WHEN 'True' THEN 1 ELSE 0 end
Begin
insert into TBL_ORDER (Guest_ID,Total_price,Submit_time,Order_Type,PhoneNo,CellProvider,Status,RoomNumber)
values(2,0,'2008-8-30 13:49:50',7,11,7,0,11)
set @TempID =@@identity
insert into TBL_HOUSEKEEPING_REQUEST_ITEM(Order_ID,Item_ID,Request,Is_Message,Price,Quantity,Details_ID)
values(@TempID,0,'2008-8-30 13:49:46',@Status,0,0,0)
end