Troubleshooting Guide: Error 350 – Invalid Column Data Type in SQL Server 2025
Why This Error Happens
Error 350 occurs when a T-SQL statement attempts to declare a table column using a user-defined table type (UDTT) as its data type, which SQL Server does not support because table types are designed exclusively for use as parameter types or variable declarations, not as column definitions. This typically happens due to a scripting mistake in CREATE TABLE or ALTER TABLE statements, often introduced during code migration, ORM-generated schema scripts, or copy-paste errors from stored procedure definitions. It can also surface when deployment scripts (DACPAC/SSDT projects) reference a table type incorrectly in a column definition rather than in a procedure signature.
Step-by-Step Resolution Guide
Step 1: Identify the Offending Column Definition
- Open the exact script or migration file referenced in the error message and locate the column name shown in the
%.*lsplaceholder. - Check whether the column’s data type matches a name registered in
sys.table_typesby running:
SELECT name FROM sys.table_types;
- Confirm the column was mistakenly assigned a table type instead of a scalar type (e.g.,
INT,VARCHAR(50),DECIMAL(10,2)).
Step 2: Correct the Column Data Type in the Script
- Replace the invalid table-type reference with an appropriate native SQL Server data type.
- Example fix:
-- Incorrect
CREATE TABLE dbo.Orders (
OrderID INT PRIMARY KEY,
OrderDetails dbo.OrderDetailType -- Invalid: table type used as column
);
-- Corrected
CREATE TABLE dbo.Orders (
OrderID INT PRIMARY KEY,
OrderDetails NVARCHAR(MAX) -- Use a valid scalar type
);
- If the intent was to pass structured data, use the table type only in a stored procedure parameter, not in a table column:
CREATE PROCEDURE dbo.InsertOrderDetails
@Details dbo.OrderDetailType READONLY
AS ...
Step 3: Validate SSDT/DACPAC or ORM-Generated Scripts
- If using SQL Server Data Tools (SSDT) or Entity Framework migrations on Windows Server 2025/Windows 11, regenerate the schema script and inspect the
.sqlfile under your project’sTables\folder for erroneous type mappings. - Ensure entity model mappings do not map a complex/table-valued property directly to a column attribute.
Step 4: Re-run the Deployment Script
- Execute the corrected script via SQL Server Management Studio (SSMS) or
sqlcmd:
sqlcmd -S localhost -d YourDatabase -i "C:\Scripts\FixSchema.sql"
- Confirm no Error 350 is returned in the output.
Alternative or Verification Steps
- Run
sp_help 'dbo.Orders'(or your affected table) to confirm all columns now show valid, native SQL Server data types. - If the error persists in an automated deployment pipeline, check the DACPAC model (
.dacpacfile) for corrupted metadata by rebuilding the SSDT project from source control rather than an old artifact.