0

I have a constraint that will not let me add it if the conditions are invalid, but the constraint allows invalid data into the table after it is added. I would like to debug what it is doing at run time, but I cannot figure out how to create either the proper trace or how to print some sort of debug message from a constraint.

I have not been able to find any resources to do this.

Elias
  • 93
  • 1
  • 9

1 Answers1

0

You can actually create a trace specifically for your insert.

If you highlight the query inserting the data and click on Trace Query in SQL Server Profile then it will create a trace specifically for your query.

enter image description here

After the trace has been created just run the original insert and then look at your trace. You will see all of the queries run during the trace. You will only see the results of the return, not the queries themselves.

Elias
  • 93
  • 1
  • 9