The character string that starts with ... is too long. Maximum length is 4000

  • Can anyone tell me if there is a way to get around the 4000 character limit for executing dynamic SQL statements? I have tried everything I can think of to get around this limitation but I can not figure out a way around this.

    Here's the error code below "Msg 103, Level 15, State 1, Line 191

    The character string that starts with '0x4D5A90000300000004000000FFFF0000B8000000000000004000000000000000000000000000000000000000000000000000000000000000000000008000000' is too long. Maximum length is 4000."

    And here is my sql query below

    CREATE ASYMMETRIC KEY PCMFunctionsKey

    AUTHORIZATION dbo

    FROM EXECUTABLE FILE = '0x4D5A90000300000004000000FFFF0000B80000000000000040000000000000000000000000000000000000000000000000000000000000000000

    CREATE LOGIN PCMFunctionsLogin FROM ASYMMETRIC KEY PCMFunctionsKey

    GRANT EXTERNAL ACCESS ASSEMBLY TO PCMFunctionsLogin

    GO

    I have all the admin permission and admin rights to the database but I'm not able to create the Asymmetric key. Also, I'm using SQL Server 2008R2 and VS2010 VB.Net 2010, and I'm using tmw_test as the database which is where ALL the sp_ and the assemblies as well as other files are located. Any help would be greatly appreciated.

  • I believe the "EXECUTABLE FILE = " is supposed to be a file path to the executable, not the executable binary code itself.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Thank you I will look into and report back. Thank you again for your help.

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

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