none
The OLE DB provider "MSDASQL" for linked server "MYSQL" supplied invalid metadata for column "IncCreated". The precision exceeded the allowable maximum.

    Question

  • I had a running openquery as follow in MSSQL SERVER.

    SELECT * FROM OPENQUERY(MYSQL, 'CALL GASP_sales_tl_performance_summary(''2013-03-01'',''2013-05-01'')')

    When i Execute this open Query will get an Error Message like this

    The OLE DB provider "MSDASQL" for linked server "MYSQL" supplied invalid metadata for column "IncCreated". The precision exceeded the allowable maximum...

    Plz Can anyone help me?

    Wednesday, May 08, 2013 11:47 AM

Answers

  • Wouldn't it be better to say:

    CAST (ifnull(SUM(increated), 0) AS decimal(38,2)) AS IncCreated

    in case MySQL has some weird rule about the data type from a SUM expression.

    Now, if Ravuri777 would tell us what the data type of increated is that could help...


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by RSamba Friday, May 10, 2013 9:49 AM
    Thursday, May 09, 2013 6:21 PM
  • Hi,

    In MYSQL "Increated' column datatype is Bigint(20),

    So I did changes the all the columns contain SUM Aggreagation

    CAST (ifnull(SUM(increated), 0) AS decimal(38,2))

    in the stored procedure like that.

    its working fine MSSQL Server.


    • Edited by RSamba Friday, May 10, 2013 5:41 AM
    • Marked as answer by RSamba Tuesday, July 16, 2013 7:40 AM
    Friday, May 10, 2013 4:06 AM

All replies

  • There must be some aggregate function involved ..is "GASP_sales_tl_performance_summary"  a procedure and you are passing value to it.Is it using function Sum().


    Soldier..Sir we are surrounded from all sides by enemy.. Major: Good, we can attack in any direction Thats attitude..

    Wednesday, May 08, 2013 12:19 PM
  • Can you try this code.

    declare @sql nvarchar(2000)
    Set @sql = 'Your procedure call here ''parameters1,parameter2,......'''
    exec (@sql) At [YourLinkedServername]


    Srinivasan

    Wednesday, May 08, 2013 12:54 PM
  • Ravuri,

    Have you raised two threads for the same question...below thread is also with your name and same problem please remove one post

    http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/cacbf7e0-88b7-4133-be49-c2d4247bb6d2


    Soldier..Sir we are surrounded from all sides by enemy.. Major: Good, we can attack in any direction Thats attitude..

    Wednesday, May 08, 2013 1:16 PM
  • And the complete error message is?

    Judging from the fragment I see, it appears that the MySQL returns data that SQL Server is not abel to cope with, and that you need to change the procedure GASP_sales_tl_performance_summary.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Wednesday, May 08, 2013 10:24 PM
  • Hi,

    wt will i do resolve this issue?

    Can u tell briefly how to go further?

    Thursday, May 09, 2013 9:03 AM
  • You need to investigate what data types that are returned from MySQL. It may return types that SQL Server are not able to handle.

    You could also consider using the OLE DB provider for MySQL rather than using MSDASQL + the ODBC driver for MySQL.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Thursday, May 09, 2013 9:27 AM
  • Hi Srinivasan,

    The above code is not worked ,

    Can u tell me the another approach?

    Thursday, May 09, 2013 11:51 AM
  • You are applying sum() function, on datatype which SQL does not identifies can you tell me the data type used.SQL Server max Precision is 38 (default).

    Try using cast statement to convert data type to decimal

    sum(cast(Increated as decimal (38,2)).


    Soldier..Sir we are surrounded from all sides by enemy.. Major: Good, we can attack in any direction Thats attitude..


    • Edited by Shanky_621 Thursday, May 09, 2013 11:56 AM
    Thursday, May 09, 2013 11:55 AM
  • Wouldn't it be better to say:

    CAST (ifnull(SUM(increated), 0) AS decimal(38,2)) AS IncCreated

    in case MySQL has some weird rule about the data type from a SUM expression.

    Now, if Ravuri777 would tell us what the data type of increated is that could help...


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by RSamba Friday, May 10, 2013 9:49 AM
    Thursday, May 09, 2013 6:21 PM
  • Hi,

    In MYSQL "Increated' column datatype is Bigint(20),

    So I did changes the all the columns contain SUM Aggreagation

    CAST (ifnull(SUM(increated), 0) AS decimal(38,2))

    in the stored procedure like that.

    its working fine MSSQL Server.


    • Edited by RSamba Friday, May 10, 2013 5:41 AM
    • Marked as answer by RSamba Tuesday, July 16, 2013 7:40 AM
    Friday, May 10, 2013 4:06 AM