如何显示带有外键= myId的表名
我试图找出带有每种语言翻译的表的主键作为外键的位置。
这是我已经拥有的......
SELECT *
FROM ( SELECT TM.seqtrans, T.trans, CASE T.seqlang WHEN 1 THEN 'NL'
WHEN 2 THEN 'FR'
WHEN 3 THEN 'EN'
WHEN 4 THEN 'DE'
WHEN 12 THEN 'SK'
END lang
FROM acc.translation_map TM
INNER JOIN acc.translation T on TM.seqtrans = T.seqtrans
WHERE TM.seqcust = @seqcust ) AS p
PIVOT ( MAX(trans) FOR lang IN ([NL],[FR],[EN],[DE], [SK])
) AS pvt
现在我需要以某种方式使用系统表来检查 seqtrans 并显示所有表名。
这可能吗?
I am trying to figure out where my primary keys of a table with translation per language resides as a foreign key.
This is what i already have ...
SELECT *
FROM ( SELECT TM.seqtrans, T.trans, CASE T.seqlang WHEN 1 THEN 'NL'
WHEN 2 THEN 'FR'
WHEN 3 THEN 'EN'
WHEN 4 THEN 'DE'
WHEN 12 THEN 'SK'
END lang
FROM acc.translation_map TM
INNER JOIN acc.translation T on TM.seqtrans = T.seqtrans
WHERE TM.seqcust = @seqcust ) AS p
PIVOT ( MAX(trans) FOR lang IN ([NL],[FR],[EN],[DE], [SK])
) AS pvt
Now i need to somehow use a system table to check the seqtrans and show all the tablenames.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
系统存储过程 sp_fkeys 正是您所需要的,您可以像这样调用它:
Books Online 有有关其他参数及其用途的更多信息。
The system stored procedure sp_fkeys is what you need, and you can call it like this:
Books Online has more info about the other parameters and what they do.