How to use identifier() as reference
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 07:15 PM
Hello,
i am trying to build some dynamic sql scripts using this identifier() clause. This works fine when it is used with [ select * from identifier (mytable) ]. However, when I try to use this identifier as a reference to a foreign key table, it doesn’t work. For example,
CONSTRAINT s_t_fk FOREIGN KEY(fk1) REFERENCES identifier(mytable).
Any idea how to use an identifier() or a variable when referencing to table? I am using sql warehouse. Not spark sql. Thank you