Skip to content

Commit 3a2bc61

Browse files
andreasjordanclaude
andcommitted
Testing Copy-DbaDbTableData - Select the id column with the case it was created with
The two Query-mode tests select "Id" from dbo.dbatoolsci_example4, whose column is "id". On a case insensitive instance that is the same column; on a case sensitive one the server answers "Invalid column name 'Id'" and the test fails with "Expected 1, but got $null". Found by the first setCS run whose COPY lane sits on the case sensitive SQL05 instances. (do Copy-DbaDbTableData) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 58bd859 commit 3a2bc61

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/Copy-DbaDbTableData.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ Describe $CommandName -Tag IntegrationTests {
108108
}
109109

110110
It "Copy data using a query that relies on the default source database" {
111-
$result = Copy-DbaDbTableData -SqlInstance $TestConfig.InstanceCopy2 -Database tempdb -Table dbo.dbatoolsci_example4 -Query "SELECT TOP (1) Id FROM dbo.dbatoolsci_example4 ORDER BY Id DESC" -DestinationTable dbatoolsci_example3 -Truncate
111+
$result = Copy-DbaDbTableData -SqlInstance $TestConfig.InstanceCopy2 -Database tempdb -Table dbo.dbatoolsci_example4 -Query "SELECT TOP (1) id FROM dbo.dbatoolsci_example4 ORDER BY id DESC" -DestinationTable dbatoolsci_example3 -Truncate
112112
$result.RowsCopied | Should -Be 1
113113
}
114114

115115
It "Copy data using a query that uses a 3 part query" {
116-
$result = Copy-DbaDbTableData -SqlInstance $TestConfig.InstanceCopy2 -Database tempdb -Table dbo.dbatoolsci_example4 -Query "SELECT TOP (1) Id FROM tempdb.dbo.dbatoolsci_example4 ORDER BY Id DESC" -DestinationTable dbatoolsci_example3 -Truncate
116+
$result = Copy-DbaDbTableData -SqlInstance $TestConfig.InstanceCopy2 -Database tempdb -Table dbo.dbatoolsci_example4 -Query "SELECT TOP (1) id FROM tempdb.dbo.dbatoolsci_example4 ORDER BY id DESC" -DestinationTable dbatoolsci_example3 -Truncate
117117
$result.RowsCopied | Should -Be 1
118118
}
119119
}

0 commit comments

Comments
 (0)