'Incorrect Syntax near' Error in Create Type in 2005
'Incorrect Syntax near' Error in Create Type in 2005
This is getting really frustrating. I've searched and tried about everything I can think of. I have an assembly added to my database by using Sql Management Console. The assembly is called TestUDT. I have defined 4 structs within that assembly, Person, Transaction, Payment, and Seller. The assembly was added to SqlServer 2005 with dbo as the owner, the permission set is SAFE, and the assembly is signed. The structs are within the Test namespace.
When ever I type the following in a Query window, just checking the syntax fails, let alone trying to execute it.
CREATE
TYPE dbo.Seller EXTERNAL NAME TestUDT.[Test.Seller]
The error is:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'TestUDT'.
What am I doing wrong
Thanks
]Monty[
'Incorrect Syntax near' Error in Create Type in 2005
ASGMikeG
The database existed in the original SQLServer 2000 database. When I upgraded to 2005, the compatibilty level of the database remained at 2000. After changing the compatibility level to 2005, the command now works.
Important safety tip: remember to have the compatibility set to 2005 on the database if you're going to create a CLR type.
Of course, SqlServer lets you add the assembly without complaining and no where in the docs on CREATE TYPE is this mentioned.
]Monty[
Dina Holan MSFT
Niels
muraliK
Thanks
]Monty[
merc
Thanks for the suggestion. I've forwarded your idea to the customer feedback team.
Regards,
CNH
Hi Monty,
Thank you for pointing out this error in the documentation. I've created a documentation bug which will be fixed in a future refresh of Books Online.
Just as an FYI, you can create documentation bugs by clicking the Send Feedback button at the top of a topic. Your comments are used to automatically create a bug that is assigned to the appropriate writer. For SQL Server 2005, we will be releasing quarterly updates to Books Online, so you can expect to see your feedback incorporated in a fairly reasonable amount of time.
Regards,