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

Test-DbaDbCompression is completely silent for empty tables #9469

Open
ReeceGoding opened this issue Sep 13, 2024 · 10 comments
Open

Test-DbaDbCompression is completely silent for empty tables #9469

ReeceGoding opened this issue Sep 13, 2024 · 10 comments

Comments

@ReeceGoding
Copy link
Contributor

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No error. It's just a case where we silently do nothing. This happens even if -Verbose and EnableException are enabled.

Steps to Reproduce

Test-DbaDbCompression -SqlInstance MyBox -Database MyDb -Table MyEmptyTable

Test-DbaDbCompression -SqlInstance MyBox -Database MyDb -Table MyEmptyTable -Verbose -EnableException

Please confirm that you are running the most recent version of dbatools

Yes. Just updated.

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Yes. Just updated.

SQL Server Edition and Build number

SQL Server 2019. Was able to replicate on multiple versions.

.NET Framework Version

Just updated.

@ReeceGoding ReeceGoding added bugs life triage required New issue that has not been reviewed by maintainers labels Sep 13, 2024
@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

ahem .... there's no data to test compression so .... what output you'd expect ?

@ReeceGoding
Copy link
Contributor Author

@niphlod I'd expect some notice, particularly when under -verbose.

@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

notice that your table is empty and so there's no way we can test for compression ?

@ReeceGoding
Copy link
Contributor Author

@niphlod That's good practice, but it's easy to miss such things when you are checking a big number of tables. You end up in a confusing situation where some tables are doing what you expect but others don't.

As I recall, sp_estimate_data_compression_savings returns a row of 0s, which is better than silently doing nothing.

@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

yeah, my point is understanding what you're asking.
either we figure out a way to insert all the tables in the result of the function, e.g. with a "N/A" or something like that, or we warn the user only via -verbose.

@ReeceGoding
Copy link
Contributor Author

@niphlod I'm happy with either.

@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

it's all T-SQL so if it's doable it should be easy

@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

@ReeceGoding
Copy link
Contributor Author

@niphlod Thanks. I may give this a try. My list of open-source work is currently long.

@niphlod
Copy link
Contributor

niphlod commented Sep 13, 2024

no worries, it's still a good starting point for anyone who has enough time to look into it.

@niphlod niphlod added feature good first issue solution provided and removed triage required New issue that has not been reviewed by maintainers bugs life labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants