Found Multiple integrity constraints with same name on a table.

Reply
Occasional Contributor
Posts: 13

Found Multiple integrity constraints with same name on a table.

I found multiple (more than 100) Integrity constraints on a single table and i am not able to drop this(warning: IC doesnot exist) .Dont know why this happened. i know i can copy the content delete the table and recreate this but is there any other better way so that i can drop all these constraints ? please find attachment i see multiple constraints when i run describe command.

 

Regards,

Gokul Shivananda

Attachment
Grand Advisor
Posts: 9,567

Re: Found Multiple integrity constraints with same name on a table.

You can delete all these Integrity Constraint via keyword _ALL_ :

 

data have;
 set sashelp.class;
run;


proc datasets library=work nodetails nolist;
 modify have;
 ic create age = check(where=(age between 1 and 99));

 contents data=have;

quit;


proc datasets library=work nodetails nolist;
 modify have;
 ic delete _ALL_;

 contents data=have;

quit;
Occasional Contributor
Posts: 13

Re: Found Multiple integrity constraints with same name on a table.

Thanks Xia Keshan for your help , but i get the same error.
Grand Advisor
Posts: 10,192

Re: Found Multiple integrity constraints with same name on a table.

Please post the exact code run and log results.

 

Also, do you have permissions to write and modify datasets in the library where the data file exists? By any chance is it a database and not native SAS dataset?

Grand Advisor
Posts: 9,567

Re: Found Multiple integrity constraints with same name on a table.

Can you post your code and LOG. Especially the LOG of  proc contents .

Ask a Question
Discussion stats
  • 4 replies
  • 288 views
  • 2 likes
  • 3 in conversation