declare @gloop char(15)
declare @gctr int
declare @tctr int
set @tctr=0
set @gctr=0
select G_name from Guild
set @tctr = @@ROWCOUNT
while @gctr<@tctr
BEGIN
set @gctr = @gctr + 1
select @gloop=G_name from Guild
select * from Guildmember where G_Name=@gloop
IF @@ROWCOUNT < 2
begin
delete from Guildmember where G_Name = @gloop
delete from Guild where G_Name = @gloop
end
END