IF EXISTS(select * FROM sys.views where name = 'view_name')
DROP VIEW view_name
if OBJECT_ID('SPD_Beneficios') is not null
Drop table SPD_Beneficios
ALTER TABLE propostas_arquivo
ADD CONSTRAINT fk_propostas_arquivo_1 FOREIGN KEY (nrocorretor)
REFERENCES propostas (nrocorretor)
go
id int identity(1,1) primary key