Forum Discussion
Changing data connection from ODBC to SQL
- 9 years ago
The last line should just be :
#"Filtered Rows1"
Also, for some reason you changed the names of some of your steps but are still referring to the old steps.
Old
Source = Odbc.DataSource("dsn=Dataext", [HierarchicalNavigation=true]), data1234_Database = Source{[Name="data1234",Kind="Database"]}[Data], dbo_Schema = data1234_Database{[Name="dbo",Kind="Schema"]}[Data], ttfacr200140_Table = dbo_Schema{[Name="ttfacr200140",Kind="Table"]}[Data], #"Renamed Columns" = Table.RenameColumns(ttfacr200140_Table,{{"t_ttyp", "Document Type"}, {"t_ninv", "Document Number"}, {"t_itbp", "Invoice to BP"}, {"t_docd", "Document Date"}}),New
Source = Sql.Databases("177.101.5.67\Dataext"), data1234 = Source{[Name="data1234"]}[Data], dbo_ttfacr200140 = data1234{[Schema="dbo",Item="ttfacr200140"]}[Data], #"Renamed Columns" = Table.RenameColumns(ttfacr200140_Table,{{"t_ttyp", "Document Type"}, {"t_ninv", "Document Number"}, {"t_itbp", "Invoice to BP"}, {"t_docd", "Document Date"}}),I'm not sure why you changed your query up like that but you are referring to steps that do not exist in your query and that's going to cause problems. The idea was to swap out the Source line and the Source line only.
The last line should just be :
#"Filtered Rows1"
Also, for some reason you changed the names of some of your steps but are still referring to the old steps.
Old
Source = Odbc.DataSource("dsn=Dataext", [HierarchicalNavigation=true]),
data1234_Database = Source{[Name="data1234",Kind="Database"]}[Data],
dbo_Schema = data1234_Database{[Name="dbo",Kind="Schema"]}[Data],
ttfacr200140_Table = dbo_Schema{[Name="ttfacr200140",Kind="Table"]}[Data],
#"Renamed Columns" = Table.RenameColumns(ttfacr200140_Table,{{"t_ttyp", "Document Type"}, {"t_ninv", "Document Number"}, {"t_itbp", "Invoice to BP"}, {"t_docd", "Document Date"}}),New
Source = Sql.Databases("177.101.5.67\Dataext"),
data1234 = Source{[Name="data1234"]}[Data],
dbo_ttfacr200140 = data1234{[Schema="dbo",Item="ttfacr200140"]}[Data],
#"Renamed Columns" = Table.RenameColumns(ttfacr200140_Table,{{"t_ttyp", "Document Type"}, {"t_ninv", "Document Number"}, {"t_itbp", "Invoice to BP"}, {"t_docd", "Document Date"}}),I'm not sure why you changed your query up like that but you are referring to steps that do not exist in your query and that's going to cause problems. The idea was to swap out the Source line and the Source line only.
Greg_Deckler PBI automatically generated the first three lines of that new query when i made the sql connection, thats why I figured it should overwrite the lines above "#" in the old odbc query.
So do you mean to say that the only line i need to over write is "
Source = Odbc.DataSource("dsn=Dataext", [HierarchicalNavigation=true]),From the old query, with
Source = Sql.Databases("177.101.5.67\Dataext"),and replace all
dbo_ttfacr200140
in the new query with
ttfacr200140_Table
From the old query?
- Anonymous9 years agoNot applicable
Greg_Deckler
I just replaced the source lines only, that being the top line. Now the applied steps are back, however I get a new error.
"Expression.Error: The key didn't match any rows in the table.
Details:
Key=Record
Table=Table"- Anonymous9 years agoNot applicable
I GOT IT WORKING!
Thanks for your help Greg_Deckler - Anonymous7 years agoNot applicable
I get this error also ...
"Expression.Error: The key didn't match any rows in the table.
Details:
Key=Record
Table=Table"... what did you do about it?
- Anonymous7 years agoNot applicable
If you share the code with me from the query editor i can probably rewrite it for ya.