Community discussion forum

Can't Get SQL 2005 CLR to Work!

  • 1 year ago

    I can't do a simple CLR test. I'm getting: Incorrect syntax near DoWork, see code below.

    Reasearch on the web for this error says set the compatibility level of the database to 90. The database is set to 90.

    What am I doing wrong? Thanks for the help.

    sp_configure 'clr enabled',1
    go
    reconfigure with override
    go

    Successful.

    CREATE ASSEMBLY SprocTest
    FROM 'C:\SprocTest.dll'

    Successful.

    CREATE PROC SprocTest
    AS EXTERNAL NAME SprocTest.Class1.DoWork

    Msg 6505, Level 16, State 1, Procedure SprocTest, Line 2
    Could not find Type 'Class1' in assembly SprocTest.

    Place [ ] around external name

    CREATE PROC SprocTest
    AS EXTERNAL NAME [SprocTest.Class1].DoWork

    Msg 102, Level 15, State 1, Procedure SprocTest, Line 3
    Incorrect syntax near DoWork.

  • 1 year ago

    ANSWER

    EXTERNAL NAME [SprocTest.Class1].DoWork

    needs to be

    EXTERNAL NAME SprocTest.[SprocTest.Class1].DoWork

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback