mattyboy2000
Programmer
Hello,
I am creating a script to create a copy of a table then loop thorough an audit table and roll the changes back.
The problem I am facing is that some of the fields have been changed to not allow nulls. When I'm looping through the audit table and calling updates I am getting an error.
What I want to do is to automate changing all the fields in my new table (apart from the primary key) to allow nulls. I was going to use simple alter table statements, but because I need to know the data type if makes it a bit more complex.
Any ideas how to do this easily?
Thanks
Matt
I am creating a script to create a copy of a table then loop thorough an audit table and roll the changes back.
The problem I am facing is that some of the fields have been changed to not allow nulls. When I'm looping through the audit table and calling updates I am getting an error.
What I want to do is to automate changing all the fields in my new table (apart from the primary key) to allow nulls. I was going to use simple alter table statements, but because I need to know the data type if makes it a bit more complex.
Any ideas how to do this easily?
Thanks
Matt