This is a "in case anyone ever runs into this" type of post...

I started getting this error at the end of a long Friday in my WebApp during a server side request_save triggered by a POST API.

The error made no sense, especially after I fired up SQL Server Profiler and checked the SQL being generated by the driver, which looked fine. It generated the same exact error if I copied/pasted/ran it in SSMS.

The SQL generated by the driver named the right columns, and the right number of supplied values in the same order as the column names.

Various INSERT INTO statements I manually wrote also produced the same error, whether or not I specified no columns, all columns, some columns (and always supplied the correct number of values).

The same error was generated if I opened View Table in the Studio and tried to save a new record.

It would have to wait until Monday (I hate leaving the office with an unsolved problem.)

Today I found the SQL statements I tested would run fine against my demo database--just not against my dev database.

Somehow the table in my dev database was (technical term) borked.

I read something about ALTER TABLE statements possibly changing the order in which SQL expected columns to be provided in an INSERT statement (which only seems like a problem if you don't specify the column names and provide values for all columns in the INSERT statement... but why would that factor into a statement where the columns are named?) Recreating the table is a solution in this situation.

Running out of ideas, I tried it.

Solution: SSMS, Tasks->Generate Scripts->Select table, Advanced: "Script DROP and CREATE", "Types of data to script: Schema and data", "Script Indexes: TRUE"

Wut?

I feel like I waved a dead chicken over the problem. But it works now.