Solved Invalid object temp table in Stored Procedure while adding to dataset .NET

Опубликовано: 07 Август 2026
на канале: techsapphire
4,219
23

Solution for fixing this issue is:
Add below script in beginning of your SP.

IF 1=0 BEGIN
SET FMTONLY OFF
END

FMTONLY returns only metadata to the dataset. Can be used to test the format of the response without actually running the query.

Example
SET FMTONLY ON;
GO
SELECT * FROM Orders;
GO
SET FMTONLY OFF;
GO

Above query will give column output without data.