Multiple constraints, the format becomes messy
zhiyounet
Posts: 10 New member
in SQL Prompt
Formatted before:
alter table gldz
add constraint ck_gldz_1 check (gxflbm like '0[1-8]'),
constraint ck_gldz_2 check(fwlbm like '01%'),
constraint ck_gldz_3 check(wlbm like '01%'),
constraint ck_gldz_4 check(left(fwlbm,4)=left(wlbm,4)),
constraint fk_gldz_5 foreign key (gxflbm) references gxfl(gxflbm),
constraint fk_gldz_Inventory_6 foreign key (fwlbm) references Inventory(cInvCode),
constraint fk_gldz_Inventory_7 foreign key (wlbm) references Inventory(cInvCode);
Hope for a number of constraints, the conditions can not format, this is actually better.
alter table gldz
add constraint ck_gldz_1 check (gxflbm like '0[1-8]'),
constraint ck_gldz_2 check(fwlbm like '01%'),
constraint ck_gldz_3 check(wlbm like '01%'),
constraint ck_gldz_4 check(left(fwlbm,4)=left(wlbm,4)),
constraint fk_gldz_5 foreign key (gxflbm) references gxfl(gxflbm),
constraint fk_gldz_Inventory_6 foreign key (fwlbm) references Inventory(cInvCode),
constraint fk_gldz_Inventory_7 foreign key (wlbm) references Inventory(cInvCode);
Hope for a number of constraints, the conditions can not format, this is actually better.
Tagged:
Comments
Just to make sure I'm understanding correctly, do you mean that you would like each constraint to remain on a separate line as it does in the "Formatted before"?
Please let me know if I'm misunderstanding!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
If I have misunderstood the original issue you reported, however, please let me know!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
I'll let you know once I have an update on the issue.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
I'm happy to report that this issue is resolved in the latest version of SQL Prompt, v8.0.8.2086. You can update to this from SQL Prompt>Help>Check for updates.
I hope this helps but please let me know if there are any further issues for you!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?