The purpose of this task is to generate a report showing all your foreign keys. Generally this would be considered nothing special only that this script also returns the tables, column foreign key constraint name and the relationship properties.
Here's how to do it:
First of all copy the script and paste it in Query Analyzer
Step 1: Create a temporary table to store table and column data (recommended and part of this script).
Step 2: Execute the final sql statement
Step 3: Drop the local temporary table (optional)
Note: If you have any columns in a table that are referenced more than once as a foreign key you will get duplicity for those columns, which is an excellent way of verifying your relationships too.
Generate Job Schedule Descriptions
A SELECT statement which includes the alpha description of each job's schedule
2011-11-25 (first published: 2007-11-01)
4,537 reads