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

sp_pivot_for needs to handle empty sets gracefully #588

Open
Jeffrey-Lieske opened this issue Nov 29, 2021 · 0 comments
Open

sp_pivot_for needs to handle empty sets gracefully #588

Jeffrey-Lieske opened this issue Nov 29, 2021 · 0 comments

Comments

@Jeffrey-Lieske
Copy link

sp_pivot_for will run into an issue with the dynamic sql when it tries to pivot and there are no rows in the pivot table.

To reproduce this you can run one of the example CALLs in the SP but truncate the table ahead of time.

A solution could just be to run a quick count(*) on the source table and return an error if the value = 0

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