I was building a temporary table to fill with random data to test an udf.
I can only reproduce this using temporary tables. An base table works fine (which was my workaround).
Msg 605, Level 21, State 3, Line 9
Attempt to fetch logical page (1:1273) in database 2 failed. It belongs to allocation unit 7710162566401949696 not to 1801439857176018944.
> select @@version
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1)