create procedure pro_tblgv(@MSGV smallint output,
@TENGV nvarchar(30) output,
@SODT varchar(10) output,
@DIACHI nvarchar(50) output,
@MSHHAM smallint output,
@NAMHH int output)
as
declare @kiemtra int
select @kiemtra=count(MSGV)
from GIAOVIEN where GIAOVIEN.MSGV=@MSGV
if @kiemtra<0 print N'cho insert dữ liệu'
else print '0'
declare @tontai int
select @tontai=count(MSHH)
from HOCHAM where HOCHAM.MSHH=@MSHHAM
if @tontai>0 print N'cho insert dữ liệu'
else print '1'