Troubleshooting Guide: Error 1789 — “Cannot use CHECKSUM(*) in a computed column”
Why This Error Happens
This error occurs because SQL Server 2025 explicitly disallows the CHECKSUM(*) function when it is used as part of a computed column definition, since the wildcard * requires evaluation against all columns in the row — including ones that may be added or dropped later — which conflicts with the static, pre-defined nature of a computed column’s expression. The engine cannot guarantee a stable, deterministic schema binding for CHECKSUM(*) because the column list it references is dynamic rather than fixed at creation time. This is a T-SQL syntax/design limitation rather than a permissions, port, or file corruption issue, so it will occur consistently regardless of server configuration.
Step-by-Step Resolution Guide
Step 1: Identify the Offending Computed Column Definition
- Locate the
CREATE TABLEorALTER TABLEstatement that defines the computed column. - Search specifically for a pattern like:
ALTER TABLE dbo.YourTable ADD RowCheck AS CHECKSUM(*); - Confirm via SQL Server Management Studio (SSMS) Object Explorer under Tables > Columns that the column is marked as “Computed.”
Step 2: Replace CHECKSUM(*) with an Explicit Column List
- Rewrite the computed column expression to reference specific, named columns instead of the wildcard.
- Example fix:
ALTER TABLE dbo.YourTable
ADD RowCheck AS CHECKSUM(Column1, Column2, Column3);
- This ensures the expression is deterministic and schema-bound correctly, since SQL Server can validate the exact column list at object-creation time.
Step 3: Drop and Recreate the Column (If Already Partially Created)
- If the table was left in an inconsistent state from a failed script, drop the broken computed column first:
ALTER TABLE dbo.YourTable DROP COLUMN RowCheck;
- Re-run the corrected
ALTER TABLE ... ADDstatement from Step 2. - Refresh the table metadata in SSMS (right-click database > Refresh) to confirm the column now appears without error flags.
Step 4: Validate Downstream Dependencies
- Check any stored procedures, views, or triggers that reference
CHECKSUM(*)directly in queries (not just computed columns), as these may also need updating for consistency. - Use
sp_dependsor the Dependencies viewer in SSMS to find all objects referencing the affected table.
Alternative or Verification Steps
- Verify the fix by querying the column directly:
SELECT RowCheck FROM dbo.YourTable;— it should return values without throwing Error 1789. - As an alternative to
CHECKSUM, consider usingHASHBYTES('SHA2_256', CONCAT(Column1, Column2, Column3))for a more collision-resistant row-hashing approach in the computed column.