You are here: Re: sp_fkeys stored procedue is very slow « MsSQL Server « IT news, forums, messages
Re: sp_fkeys stored procedue is very slow

Posted by Erland Sommarskog on 05/19/06 01:07

(keyvez@gmail.com) writes:
> I am trying to find the tables and columns that depends on 'table1'
>
> sp_fkeys @pktable_name='table1'
>
> and this takes about eight seconds, whereas if I run it for finding all
> tables and columns that 'table1' depends on
>
> sp_fkeys @fktable_name='table1'
>
> this only takes a second.
>
> How can I speed up the first stored procedure execution?

Are there many tables in the database?

I'm afraid there is not that much you could do. You could of course
script the database from the master database, and play around with a
copy of the procedure, to see if you can make it go faster. One idea
there would be to replace the temp tables with table variables. Tracing
the procedure in Profile would of course also be necessary to see where
the time is spent.


--
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

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