How to: Fix Errors
The Error List pane displays any deployment or build errors. Syntax and semantic errors caused by editing in either the Transact-SQL Editor or Table Designer will also show up in the list when you are editing database entities and its definitions. The Error List is dynamically updated as you edit scripts across different tabs. You can then follow the errors identified for further troubleshooting.
|The following procedures use entities created in procedures in the Connected Database Development and Project-Oriented Offline Database Development sections.|
To fix errors
Right-click the Product table (Product.sql) in Solution Explorer and select View Designer .
In the Columns Grid of the designer, right click the ShelflLife column and select Delete to delete this column from the table.
Notice that in the Error List pane at the bottom of the screen, a warning and an error similar to the followings pop up immediately.
Warning SQL71502: Function: [dbo].[GetProductsBySupplier] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[Product].[p]::[ShelfLife] or [dbo].[Product].[ShelfLife].
Error SQL71501: Check Constraint: [dbo].[CK_Product_ShelfLife] has an unresolved reference to object [dbo].[Product].[ShelfLife].
You can right-click the Error List and use the contextual menus to sort results, filter which entries you want to display, and which columns of information you want to appear for each entry.
Double-click the first warning identified and follow it to the script file that generated the warning. The problematic code section is highlighted. In our example, it is because the
ShelfLifecolumn is being used by both a
SELECTstatement in a table-value function we created previously.
In the Transact-SQL Editor, remove
ShelfLifefrom the function.
Fix the 2nd error in a similar manner by removing the check constraint.
Notice that the warning and error disappear from the Error List immediately after you fix the problems.
Other ResourcesUse Transact-SQL Editor to Edit and Execute Scripts