Forum Discussion
Element115
Memorable Member
2 years agoQUESTION::SQL ENDPOINT::INFORMATION_SCHEMA::QUERY RETURN NOTHING
Why do the following 2 TSQL queries return an empty result set? Also nothing with a WHERE clause on a table name in the LH. SELECT *
FROM INFORMATION_SCHEMA.VIEW_COLUMN_USAGE SEL...
- Anonymous2 years ago
Element115
Memorable Member
2 years agoActually, I take back my previous answer. I just tried running both TSQL queries on a LH that has a view, and as you can see in my screenshot, it does not work on my end:
Anonymous
2 years agoNot applicable
Hi Element115
How did you create the view? Can you please share the code here?
If you create the view using the tables present in lakehouse, then it would be shown in the sql query result.
- Element1152 years ago
Memorable Member
CREATE VIEW vTABLE_NAMES AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' ;- Anonymous2 years agoNot applicable
- Element1152 years ago
Memorable Member
In this case, with a VIEW on a user created table, it works.
But why does it not work for VIEWs on the INFORMATION_SCHEMA? Ahhh because they are all views in this schema and not tables. Duh.