if exists (select * from sys.sysobjects where id = object_id(N'dbo.PamFolder')) and not exists(select 1 from dbo.PamFolder where FolderID is null)
begin
    insert into dbo.PamFolder (ID, FolderID, Name) values (newid(), NULL, 'root');
end