THE ZEPINT NETWORK

programmer assist

Databases Databases XML Feeds

Databases Questions Databases Solutions Databases Articles

A database is a collection of information stored in a computer in a systematic way, such that a computer program can consult it to answer questions. The software used to manage and query a database is known as a database management system (DBMS). The properties of database systems are studied in information science.

Faster Version of sp_fkeys for SQL Server 2005

DiggBlinkRedditDeliciousTechnorati

article by keyvez

If you've ever wanted to find the foreign keys that depend on a particular table or a primary key that acts as a foreign key in other tables, you could use the sp_fkeys system procedure provided in SQL Server.

However, since SQL 2005 sp_fkeys has become really slow. Depending on the size of the database it could enormously add to the execution time for a particular table.

Here is a modified stored procedure which matches the execution speed of the 2000 version of sp_fkeys on 2005.

The resultset and returnvalues are exactly like the sp_fkeys stored procedure and I admit that the only change I made was added a new if block to the actual code.

Download it at: http://www2.keyvez.com:82/?q=node/12

Got a Databases Question?

Just Sign Up and ask the top Databases experts!

Search via Google

User Login

Email Address

Password

Databases Experts

Rank Expert Points
#1 keyvez 500
#2 Bejaan 500
This a list of the Top Databases experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?