Re: Creating Not Null contraints in SE



Oh if I could ... But dbexport needs to use dbschema to work and
dbschema is failing with -100 errors. The alter table worked but that
did not fix the 100 errors. I am just building a huge brute force sql
file to run instead of trying to be smart and doing a program to
rebuild it all. I've gone through 50 of 180 tables and 38 so far have
to be rebuilt. I have four other dbs of about the same size to do as
well, I bet the problems there will be about the same. It is mind
nulling. Thanks for all your help though.




NOT NULL constraints cannot be 'ADDED' they have to be MODIFIED:

ALTER TABLE xredit_cards MODIFY (somecolumn some type NOT NULL
CONSTRAINT some_constr_name);

But, why struggle. When you dbexport, have dbexport write the SQL
file to disk and just edit the disk file to change the constraint
names in the CREATE TABLE statements in the file. Alternatively, for
others reading htis who are not using SE - sonce we've already
determined that myschema no longer works for SE databases (sigh) - you
can use the '-l' option to myschema to create a dbimport compatible
schema with the constraints renamed for you (actually for NOT NULL
constraints I just drop the constraint names so that the new database
creates new names.

Art S. Kagel


.



Relevant Pages

  • Re: Flaw in dbschema
    ... when I do dbschema -d DB and take count for indexes of owner abcd. ... Those index names that don't show up are not part of dbschema starts ... a primary key, foreign key, or unique constraint. ... Look at the constraints on the table in dbschema ... ...
    (comp.databases.informix)
  • Re: Delete query taking long time to execute
    ... I have asked him to do the NOCHECK when the system is offline (No users ... constraints [See ALTER TABLE WITH NOCHECK] to make the DELETE faster. ...
    (microsoft.public.sqlserver.mseq)
  • How to check if triggers and constraints are enabled/disabled?
    ... I can disable and enable triggers and constraints with sql-statements shown ... ALTER TABLE mytable NOCHECK CONSTRAINT ALL ... How can I check if triggers and constraints are enabled or disabled? ...
    (microsoft.public.sqlserver.programming)
  • drop column fails
    ... alter table TE20_AREA ... checked for indexes, constraints, relations ... help because db modification needs to be in a batch job :- ...
    (microsoft.public.sqlserver.server)
  • Re: Disable relationships
    ... ALTER TABLE DISABLE CONSTRAINTS ALL ... We have a table that indicates the people in the SQL Server 2K ... > painful with the current foreign key relationships we have. ...
    (microsoft.public.sqlserver.programming)