Skip to content

Instantly share code, notes, and snippets.

@biliboss
Last active December 31, 2015 12:19
Show Gist options
  • Save biliboss/7985564 to your computer and use it in GitHub Desktop.
Save biliboss/7985564 to your computer and use it in GitHub Desktop.
MSSQL Quick Scripts

DROPS

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

Constraints

ALTER TABLE propostas_arquivo
ADD CONSTRAINT fk_propostas_arquivo_1 FOREIGN KEY (nrocorretor)
    REFERENCES propostas (nrocorretor)
go   

Fields

id int identity(1,1) primary key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment