limit to # of cols can be used with columns_updated() function?

  • Is there a limit to the number of columns this function can handle?? I have a table that this function goes against inside an upate trigger but when I add the 104th column (thru ALTER table add col) the function fails. But it worked when I added the 103rd and 102nd. So is there a limit or is something else wrong?? Weird thing is, if I DROP/CREATE the table and re-add the trigger the function works fine against 106 columns?

    Any info would be GREATLY APPRECIATED!

    Al

  • I don't know of a maximum but it may be related to the fact that columns_update() returns a bitmask and that 2^104 is quite a large number.

    I would consider changing your database design to have less than 104 columns in a table.  Updates to this many columns are expensive because of the DELETE/INSERT method that SQL Server uses most of the time. 

     

  • I know this is an old post, but I'm curious as well since the table I'm using has 220 columns in it.

    Split the table? Can't, it's replicated from a junky DB2 db from another company, which we have no control over. 🙂

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

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