SET FMTONLY ON - Where does this come from

  • In doing monitoring and troubleshooting I have found a lot of the following statement as lead blockers in on and off blocking on a production server:

    SET FMTONLY ON select CONSTRAINT_NAME, CONSTRAINT_CATALOG from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where 1=2 SET FMTONLY OFF

    The problem is I can't seem to find where this statement is coming from, it is not is the Perl code that we use, or any of the SQL scripts.

    Anyone have any ideas?

    Nancy

  • Obviuosly a Sql code

    http://technet.microsoft.com/en-us/library/ms173839.aspx

    Google it to get more details

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Thanks for responding. It is obviously SQL code, the problem is I cannot figure out who/what is call that particular code. It is not in any SQL script for the application.

    Could it be called by an internal SQL process or by an ODBC driver?

    Nancy

  • I solved a similar mystery by running a profiler trace to find where it was coming from. It was an SSIS package on another server.

  • Lots of things like ADOc, ORMs, autogenerate code, SSIS, etc gather information about recordsets and other metadata under the covers. I recommend you use various columns in sysprocesses or the replacement DMVs and also Profiler to capture information about what user, machine, application, etc is making these calls. Then you can go give them the what for, how come and why not! 🙂

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • I can tell you that SSIS packages can generate code that looks very similar to what you are asking about.

    If you have SSIS in your environment, Id start with those folks.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply