The copy-pastes and explanations blog for SQL code, errors and daily cases!
This blog is a 'list' of actions that always good to have available.
The copy-paste concept here is short and clear explanations and descriptions (no long stories!) and - of course - the code to take (copy) and use (paste).
The blog deals in the database (mostly) and software issues.
Blog Pages
▼
SAP ASE (Sybase) - Create FOREIGN KEY on exists table
IF NOT EXISTS (select * from sysobjects where name = 'FK_NAME' and type = 'RI') ALTER TABLE [dbo].[TABLENAME] ADD CONSTRAINT FK_NAME FOREIGN KEY ([COLUMNNAME]) REFERENCES [dbo].[REF_TABLENAME] ([REF_COLUMNNAME]) GO
No comments:
Post a Comment