Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense: do not list empty schemas #35

Closed
isc-tleavitt opened this issue Dec 8, 2022 · 1 comment
Closed

Intellisense: do not list empty schemas #35

isc-tleavitt opened this issue Dec 8, 2022 · 1 comment

Comments

@isc-tleavitt
Copy link
Contributor

Compare:
select * from INFORMATION_SCHEMA.SCHEMATA

With:
select * from INFORMATION_SCHEMA.SCHEMATA s where exists (select top 1 1 from INFORMATION_SCHEMA.TABLES t where t.TABLE_SCHEMA = s.SCHEMA_NAME) or exists (select top 1 1 from INFORMATION_SCHEMA.VIEWS v where v.TABLE_SCHEMA = s.SCHEMA_NAME) or exists (select top 1 1 from INFORMATION_SCHEMA.ROUTINES r where r.SchemaUpper = s.SCHEMA_NAME)

The latter should be used.

@isc-tleavitt
Copy link
Contributor Author

Actually, the issue in my case was that %SQL_MANAGER.ProceduresTree(0) lists schemas where subordinate items won't be suggested as tables. So fixing #33 for TVFs will fix this, and for the off chance that we have functions but no TVFs the impact is minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant