i want bring 1 foreign key several ones in table. in gui interface in sql server if expand table options can see folder called "keys", in folder there 1 primary key , several foreign ones. in example have 3 tables, customer, orders , items. customer has customer_id primary, items has item_id primary , orders has order_id primary, foreign key customer_nbr references customer (customer_id) , foreign key item_nbr references items (item_id).
so in "keys" folder there names keys like: "fk_orders_customer__38996ab5"
the problem number "38996ab5" follows customer word not fixed, if delete constraints re-establish them changed (for security reasons or so).
so looking sql command can typed in order key no matter like. logically use keyword "like" (i.e. ... = 'fk_orders_customer__%') not know how or put it.
thanks in advance.
use:
select * sys.foreign_keys name '%yourforeignkeyname%'
Comments
Post a Comment