[code=sql]
select 'ALTER TABLE ' + primary_table + ' drop CONSTRAINT '
+ primary_key_nam e + ' FOREIGN KEY (' + foreign_column_ 1 + ')'
from sysfkeys order by foreign_table
[/code]
How can I change this code to allow me to drop all primary keys instead of foriegn keys?
Is there an equivelant table for the primary keys as this one "sysfkeys " for the forign keys?
James
select 'ALTER TABLE ' + primary_table + ' drop CONSTRAINT '
+ primary_key_nam e + ' FOREIGN KEY (' + foreign_column_ 1 + ')'
from sysfkeys order by foreign_table
[/code]
How can I change this code to allow me to drop all primary keys instead of foriegn keys?
Is there an equivelant table for the primary keys as this one "sysfkeys " for the forign keys?
James
Comment