locked
If a record gets inserted into one of our tables with a certain column = null, create a log file, record, ... anything RRS feed

  • Question

  • User1864322503 posted

    I'm currently sifting through a solution trying to find where we have an insert into the table of interest that is allowing them to insert a null value for a column that shouldn't be allowing nulls. The column is nullable (this table has existed long before I worked here), so it's allowing nulls to go in if the query says to. I need to find where in this entire solution this insert is taking place, but that's very difficult because it could be all over the place, and I don't know exactly what the end users are doing to cause this.

    Is there a way to setup a trigger of some sort that says "if a record is inserted here with column 'x' null", create a record in table y with x,y,z, information. Essentially, I don't really see myself identifying the root of this error in the application, there are too many scenarios that this table is inserted/updated and it's not as simple as looking at objects all over the place to track their values -- lots of hard-coded queries exist in the code-behinds.

    Again,

    Is there a way to setup a trigger of some sort that says "if a record is inserted here with column 'x' null", create a record in table y with x,y,z, information. 

    I appreciate any help you may be able to provide me with, any clarification needed please dont hesitate to ask.

    Friday, April 4, 2014 2:25 PM

All replies

  • User1275632693 posted

    do you have a development copy?

    If so, change the column attribute and then try running the solution again and see if you get lucky, others I would start profiler on the the SQL server to see
    what queries are running, or perhaps someone here might have the answer as well.

     

    Friday, April 4, 2014 7:06 PM