Home Forums Data Warehousing Integration Services Conversion failed when converting from a character string to uniqueidentifier RE: Conversion failed when converting from a character string to uniqueidentifier

  • Where do the values from those variables come from? It looks to me as if you're inserting into activity_table one row at a time, which is very inefficient. But that's not directly related to the issue you're having.

    The first thing I would try is to make the @MID parameter to the stored procedure char(36). That way, you'll catch any unconvertible values that little bit earlier. The second thing to do is to validate the data upstream. If it comes from a table in SQL Server, run TRY_CONVERT on it. If it comes from a text file or similar, get it into a staging table and then TRY_CONVERT it. Can you see the value(s) that your package is failing on?

    John

    Edit: better still, make the @MID parameter uniqueidentifier.