Reply to Re: How to obtain constraint (key) info

Your name:

Reply:


Posted by Erland Sommarskog on 10/01/16 11:23

(djohannsen@yahoo.com) writes:
> i need to programmatically obtain and process constraint key
> information. the problem with the output from sp_helpconstraint is
> that it outputs 2, and sometimes 3 resultsets. (the 2nd
> resultset/constraint_keys is exactly what i need however)
>
> because the resultsets vary in output format, i cannot programmatically
> use the output to process in my DB proc. its essentially useless to
> me. i can only suppress the 1st resultset (with tablename info), and
> cannot suppress the occasional 3rd resultset (that has referencing
> foreign key info).
>
> i've tried to directly access all kinds of sytem tables but i'm not
> getting the complete info that the 2nd resultset that
> sp_helpconstraints offers.
>
> any suggestions? thanks.

I would use the Object Browser in Query Analyzer to find the procedure
and script it, and the steal the goodies that I need. I can guess
that the code is not really for the faint of heart, but if you are
wholly satisfied with that second resultset, modifying the code to
not display the foreign keys should not be difficult.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

[Back to original 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

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