The first step in troubleshooting failed object creation is to check the syntax of your Transact-SQL statement. If the syntax is correct, check the relationships of the SQL Server objects involved in the operation. Usually the problem lies either in the object relationship or in not providing enough information for SQL Server to fulfill your request.
Dropping an object is most commonly interrupted because of the relationship with other objects such as foreign keys or constraints such as NOT NULL.
Modifying a column can be interrupted because the change would cause data corruption or truncation. Expanding a table with new columns could be interrupted because you did not supply enough information even though the syntax is correct. A good example of this is adding a new column to a table with the NOT NULL attribute but without including a default value.
Troubleshooting failed object creation is much more difficult than creating new objects. You have to look at existing objects and their interactions with changes and new objects.
Answers
D. If you define a default value, SQL Server will be able to add the new column to the table. SQL Server will use this value and update all existing records. This value will also be used when new records are inserted into the table and no value has been defined for the new record. |
|
C. SQL Server reminded you that you still have a dependency issue before you can remove the column. The NOT NULL clause caused SQL Server to place a constraint on the column when it was created. Dropping the constraint will allow you to drop the column from the table. |
|
B. Someone has removed or renamed the Testing123 table. As a result, when the view is executed, SQL Server cannot find the table and the execution fails. |