ALTER TABLE PHARM.T_PACKAGE_TYPE ALTER COLUMN code int not null;
GO

INSERT INTO [VCLib].[T_GEN_NUMBERS]
           ([GenNumbersID]
           ,[EntityID]
           ,[NumberName]
           ,[NextNumber])
     VALUES
           (newid()
           ,(select e.EntityID from VCLib.T_ENTITIES e where e.EntName = 'PACKAGE_TYPE')
           ,'PHARM.PACKAGE_TYPE'
           ,(select isnull(max(Code) + 1, 1) from PHARM.T_PACKAGE_TYPE))
GO
