You are here: Re: fmtonly problem (bug ??) « MsSQL Server « IT news, forums, messages
Re: fmtonly problem (bug ??)

Posted by Erland Sommarskog on 04/17/06 16:59

(JayCallas@hotmail.com) writes:
> So FMTONLY should be avoided. Is there an alternative?
>
> For straight SELECTS against tables you could just do "SELECT * FROM
> [Table] WHERE 1 = 0" but what about stored procdures? Obviously, with a
> not-so-short stored proc I would not want to run the full query just to
> get the schema.

If you for some reason want only the structure of the result set, then
SET FMTONLY ON may be the best bet. But it is definitely a gamble, since
a stored procedure could be written to generate different result sets
depending on weekday, phase of the moon etc.

Best is to write the code so that it adapts to the result set of a
particular execution. Particularly if the stored procedures can be anything.
(FMTONLY would be OK if you know that the procedure are simple-minded
things without IF or nested SP calls.)

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация