web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

SSIS: The parameter type for ‘@P1’ cannot be uniquely deduced; two possibilities are ‘sql_variant’ and ‘xml’

AjitPatra Profile Picture AjitPatra 469

Recently, while working on SSIS we came across a situation to use parameters. We wanted to pass 2 parameters.

We were using SQL Command as Data access mode in OLE DB Source Editor.

After writing the query the below query:

select ? from channelmaster where displaychannel=?

When we clicked on parameters to provide the parameter values we got the error as shown below:

The parameter type for ‘@P1’ cannot be uniquely deduced; two possibilities are ‘sql_variant’ and ‘xml’

SSIS_Error

To fix this issue, we did the type cast of above parameters first before clicking on Parameters button. In our case, we did type cast them to varchar(30) as shown below:

select cast(? as varchar(30)) from channelmaster where displaychannel=cast(? as varchar(30))

After doing this, when we clicked on Parameters button, it asked for value of the parameters as shown below:

SSIS_Error_Fixed

Basically, when there is a scenario to select the value that comes through the parameter then we need to type cast that parameter.

Hope it helps !!

*Please note that the above example of SQL query is for demonstration purpose only, actual SQL query was different but similar.


This was originally posted here.

Comments

*This post is locked for comments