June 22, 2011 at 6:40 am
Hi All,
I need to rename Foreign key/Default constraint name.
With SP_RENAME I can rename primary key name but not Foreign key/Default name.
Please suggest how I can get this.
Thanks
KD
June 22, 2011 at 9:17 am
You could probably drop and recreate the FK constraint with the new name.
Also take a look at http://www.sqlservercentral.com/scripts/Miscellaneous/30924/ which renames all FK constraints; but should give you some ideas for renaming just the one constraint.
HTH,
Rob
June 22, 2011 at 9:35 am
i just renamed a foreign key no problem...
sp_rename 'FK__SFPLGRP__SFGROUP__000BC426','FK_SFPLGRP_to_SFGROUP'
Lowell
June 23, 2011 at 12:26 am
Thanks a lot
without table name its works.............................................
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply