Consider the following scenario. In Microsoft SQL Server 2005, you use the correct syntax of the CREATE TYPE statement to create a common language runtime (CLR) user-defined type in a database. The compatibility level of the database is set to 80. In this scenario, you receive the following error message:
Server: Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'ObjectName'.
However, you receive the expected error message if you do the following:
- You use the CREATE PROCEDURE statement or the CREATE FUNCTION statement.
- You create a CLR stored procedure or a CLR function.
The error message contains the following text:
Server: Msg 325, Level 15, State 1, Procedure ObjectName, Line 4 Incorrect syntax near 'external'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel.