ERROR 'string or binary data would be truncated'

Discussion in 'Databases' started by PharmaPAC, Jul 26, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. It took me 2 days to figure this out, so I thought I would share my info with you. While using the aspnet_regsql.exe program, I kept getting the subject error (above). After learning what the aspnet_regsql.exe program actually does, I opened the "InstallCommon.sql" script and ran each part one by one. The error is caused by the following section:



    CREATE TABLE #aspnet_Permissions
    (
    Owner sysname,
    Object sysname,
    Grantee sysname,
    Grantor sysname,
    ProtectType char(10),
    [Action] varchar(20),
    [Column] sysname
    )
    INSERT INTO #aspnet_Permissions
    EXEC sp_helprotect



    The bold part is a bug with the .NET sql script, because sp_helprotect has ACTION fields up to 38 characters. I simply changed the datatype from varchar(20) to varchar(40), and it ran just fine.


    #aspnet_Permissions is only a temporary table, which is why you don't see it in the final table list of your db. I hope this saves some of you a little time and head scratching.


    PharmaPAC (Dan)
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page