cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Conversion failed when converting from a character string to uniqueidentifier

I'm getting the following error on a table from SQL Server:

OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: Conversion failed when converting from a character string to uniqueidentifier..

Does anyone know how to get around this? I dont believe there is much I can do to change the table, since I need one of the columns to be the primary key.

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Conversion failed when converting from a character string to uniqueidentifier

Hi @GTPowerBIUser ,

 

i think it's a query folding problem.

Do you merge the query with another query?

 

Maybe you can use Table.Buffer.

https://docs.microsoft.com/en-us/powerquery-m/table-buffer

Think of Table.Buffer as, "load this table into memory, and stop folding subsequent operations back to the data source".

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

I work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #BetterTogether

Highlighted
Resolver II
Resolver II

Re: Conversion failed when converting from a character string to uniqueidentifier

Hi

 

I would one of two things in Power Query Editor

A. Change the data type to String but make sure it over-write the original

or

A. If you do not need the column, write a SQL Select and do not select the column in question

 

I hope this might help

If I answer your question, please mark my post as a solution, this will also help others.
Please give Kudos for support.

Tomas Santandreu Polanco |Principal Business Intelligence Consultant
www.designmind.com

Highlighted
Helper II
Helper II

Re: Conversion failed when converting from a character string to uniqueidentifier

The other options didn't work so I'm trying to use table.buffer but Im getting the syntax wrong. Do you know what I'm doing wrong here?

 

error: Expression.Error: The import table.buffer matches no exports. Did you miss a module reference

 

 

let
    Source = Sql.Database("prod.windows.net", "prod-db"),
    dbo_vps_Sum = Source{[Schema="dbo",Item="vps_Sum"]}[Data],
    dbo_vpsView_SumBuffered = table.buffer(dbo_vps_Sum),
    #"Replaced Value" = Table.ReplaceValue(dbo_vpsView_SumBuffered,"D MHS","D",Replacer.ReplaceText,{"End Customer"}),
    #"Trimmed Text" = Table.TransformColumns(#"Replaced Value",{{"End Customer", Text.Trim, type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Trimmed Text",{{"End Customer", "End Customer(OneView)"}})
in
    #"Renamed Columns"

 

 

Highlighted
Super User III
Super User III

Re: Conversion failed when converting from a character string to uniqueidentifier

Hi @GTPowerBIUser ,

 

it's case sensitive.  Table.Buffer

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

I work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #BetterTogether

Highlighted
Helper II
Helper II

Re: Conversion failed when converting from a character string to uniqueidentifier

Same error, except now I get it in query editor and not when refreshing the table in Power BI:

 

DataSource.Error: Microsoft SQL: Conversion failed when converting from a character string to uniqueidentifier.
Details:
DataSourceKind=SQL
DataSourcePath=prod-sql.database.windows.net;prod-db
Message=Conversion failed when converting from a character string to uniqueidentifier.
Number=8169
Class=16

 

let
Source = Sql.Databases("prod-sql.database.windows.net"),
#"prod-db" = Source{[Name="prod-db"]}[Data],
dbo_vps_Sum = #"prod-db"{[Schema="dbo",Item="vps_Sum"]}[Data],
vps_Buffer = Table.Buffer(dbo_vps_Sum)
in
vps_Buffer

 

I tried deleting the relationship between this table and another but that didn't help either.

Highlighted
Super User III
Super User III

Re: Conversion failed when converting from a character string to uniqueidentifier

Hi @GTPowerBIUser 

 

is vps_Sum an SQL table or view?

What happens if you query

 

SELECT * FROM [dbo].[vps_Sum]

 

in SQL Management Studio

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

I work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #BetterTogether

Highlighted
Super User III
Super User III

Re: Conversion failed when converting from a character string to uniqueidentifier

Hi @GTPowerBIUser ,


did you solve your problem?


If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

I work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #BetterTogether

Highlighted
Community Support
Community Support

Re: Conversion failed when converting from a character string to uniqueidentifier

@GTPowerBIUser 

 

This seems to be more related to Transact-SQL . You may visit https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=&forum=transactsql&filter=&so....

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors