‘is not a valid identifier’ for large dynamic sql statement
I was building a large, dynamic pivot table which was getting the above error.
The solution turned out to be simple, but a little bit irritating.
I was calling exec @sql
, which resulted in the error.
Changing the above to exec(@sql)
worked for sql statements greater than 500 characters.
Trackback URI |