DO
$$
BEGIN
if EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
					WHERE table_name = lower('PersonState')
					AND table_schema = lower('dbo')
					) THEN
					
				PERFORM * from dbo.xp_gen_view('dbo.PersonState', '
				ALTER TABLE dbo.PersonState ALTER COLUMN PersonFirName_FirName TYPE varchar(60);
				ALTER TABLE dbo.PersonState ALTER COLUMN PersonFirName_FirNameR TYPE varchar(60);
				ALTER TABLE dbo.PersonState ALTER COLUMN PersonSecName_SecName TYPE varchar(60);
				ALTER TABLE dbo.PersonState ALTER COLUMN PersonSecName_SecNameR TYPE varchar(60);
				', 2);

END IF;
END;
$$
