create table robotData
(
idx int not null primary key,
title varchar(50) not null unique nonclustered,
folderName varchar(50) not null unique nonclustered,
contents text not null,
date datetime default getdate(),
visit int default 0,
imgCount int default 0,
buildLevel tinyint default 0,
sourceLevel tinyint default 0,
sensorTouch bit default 0,
sensorLight bit default 0,
sensorUltra bit default 0,
sensorSound bit default 0,
sensorMotor bit default 0
)
go
----프로시져
create proc robotDataInsert
(
@title varchar(50)
@folderName varchar(50)
@imgCount tinyint
@robotLevel char(2)
@robotSensor char(5)
)
as
begin
insert into robotData values(title, folderName, imgcount, robotLevel, robotSensor)
end
go
--트리거
create trigger TRG_ROBOTDATA_INS
on robotData
instead of insert
as
begin
set nocount on;
begin tran
begin try
declare @
end try
begin catch
if @@TRANCOUNT > 0
ROLLBACK TRAN
end catch
if @@TRANCOUNT >0
COMMIT TRAN
end
댓글 영역