CLR and return value types

  • I made an CLR using C# that return a string (> 8000 char).

    Now I try to register assembly into sql server 2005 but got an error...

    Msg 6551, Level 16, State 2, Procedure ABCD, Line 2

    CREATE FUNCTION for "ABCD" failed because T-SQL and CLR types for return value do not match.

    This the function

    -------------------

    CREATE FUNCTION ABCD(@body1 TEXT, @body2 TEXT)

    RETURNS NTEXT EXTERNAL NAME HTML1.HTML21.get

    Whet type I must use for rigth use.

  • Use nvarchar(max) instead of text.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply