Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Column allows nulls I want to change no nulls allowed

    When i do a select on my emplee table for rows with null idCompany i dont get any records

    I then try to modify the table to not allow a null idCompany and i get this error message:

    'Employee (aMgmt)' table
    - Unable to modify table.
    Cannot insert the value NULL into column 'idCompany', table 'D2.aMgmt.Tmp_Employee'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    This sux

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What does a SELECT statement not returning any records have to do with allowing NULLs? And why are you doing an INSERT statment while modifying the table?

    Your post does not make much sense.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jan 2004
    Location
    Tacoma, Wa
    Posts
    15
    It would help if you poseted the 'select' statement.

    Are you using columnname = NULL or columnname IS NULL in the 'where' clause?

    I don't think you can alter a table to prohibit NULLs if NULLs already exist in the table. You'll have to change those values or provide a default when you do the alter.

  4. #4
    Join Date
    Oct 2003
    Posts
    311
    This issue seemed to be with the Check existing data on creation, i ended up getting that message on another table and when i changed check existing data on create to no there was no problem.

    BUT either way when i SELECTED * FROM myTable WHERE idColumn IS NULL
    i got no records returned


    HERE IS THE SQL On the 2nd table problem

    SELECT idMaster, idVendor, idExpType, idCompany, DateEntered, EnteredBy, CheckNumber, CheckAmount, VendorName, ExpenseType, CheckDate, voided,
    ckSuffix, MasterTs, tempCol
    FROM aDataEntry.master
    WHERE (idCompany IS NULL)

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Post the script (DDL) for the table.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •