Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AFIELDS() on cursor from SQL Server
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01463201
Message ID:
01463281
Views:
40
>>You can get similar info by querying different metadata tables.
>
>Thank you very much. I will try it.

Here is a similar query:
select Object_Name(f.constid) Constraint_name,
 Object_Name(f.fkeyid) FK_Table_name,
 c1.name FK_Column_name,
 Object_Name(f.rkeyid) PK_Table_name,
 c2.name PK_Column_name
from dbo.sysforeignkeys f
inner join dbo.syscolumns c1 On c1.id = f.fkeyid And c1.colid = f.fkey
inner join dbo.syscolumns c2 On c2.id = f.rkeyid And c2.colid = f.rkey
where Object_Name(fkeyId) = 'Foreign Table Name'  -- put the table name here you want to examine
order by Constraint_name, FK_Table_name, FK_Column_name, PK_Table_name;
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform