• I didn't know about FMTONLY ON ignoring IF/THEN blocks.

    Based on that and the fact that FMTONLY is used to get a list of column names and data types

    Why not add this to your sproc

    IF 1=0

    BEGIN

    SELECT

    fieldname1inreturnset = cast(null as fieldtype),

    ...

    RETURN

    END

    That way the quick FMTONLY on statement will just get a field list back.

    My problems with FMTONLY have involved temp tables not getting created in that case... which is why for SSIS I always start my stored proc calls in OLEDB data sources as SET FMTONLY OFF;EXEC sp_executesql N'stored proc name'



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]