You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft SQL Server 2017 (RTM-CU14-GDR) (KB4494352) - 14.0.3103.1 (X64) Mar 22 2019 22:33:11 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 18362: ) (Hypervisor)
<!-- NOTE: If the above information is not provided as a minimum your issue will not be acknowledged -->
## Errors Received
Exception calling "ExecuteWithResults" with "1" argument(s): "Execute with results failed for
Database NameWith]'. "
At C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.831\allcommands.ps1:42189 char:17
+ $resultTable = $db.ExecuteWithResults($sql).Tables[0]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FailedOperationException
Before submitting a bug report:
Collect output of following command and paste below:
PSVersion 5.1.18362.113
dbattools 0.9.831
Copy-DbaDatabase
? You can replicate it usingBackup-DbaDatabase ... | Restore-DbaDatabase ...
Environmental data
Name Value
PSVersion 5.1.18362.113
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.113
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server:
Microsoft SQL Server 2017 (RTM-CU14-GDR) (KB4494352) - 14.0.3103.1 (X64) Mar 22 2019 22:33:11 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 18362: ) (Hypervisor)
Steps to Reproduce
Get-DbaLastGoodCheckDb -SqlInstance ServerName -Database NameWith]
Expected Behavior
Should return table with LastGoodCheckDB results
Actual Behavior
Throws error as cannot handle databases that include characters that need to be escaped.
Cause
This is caused because the line in code that creates the T-SQL script$sql = "DBCC DBINFO ([$ ($db.name)]) WITH TABLERESULTS"
Line 117 -
does not properly escape any embedded ] characters
The text was updated successfully, but these errors were encountered: