SQL Adapter passes all stored procedure parameters as nvarchar

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › SQL Adapter passes all stored procedure parameters as nvarchar

Viewing 1 reply thread
  • Author
    Posts
    • #17535
      I am using a SQL Send port to call a stored procedure.  The parameters 
      include varchar, smalldatetime, and money data types.  The SQL Transport 
      Schema Generator seems to have no problem generating a schema.  It correctly 
      pulls the parameter names and data types from the database into the wizard, 
      and it creates a schema.  
      
      I first noticed a problem when all the data types in the schema were 
      xs:string.  Even if I change the datatypes that are supposed to be datetime 
      to xs:datetime and the ones that are supposed to be money to xs:float, they 
      are passed as nvarchar.  I can view the exec command in SQL profiler as it 
      runs, and every parameter is passed in as varchar.  So of course SQL returns 
      an error to BizTalk that ends up in the event log that says it cannot convert 
      nvarchar to money datatype (or float datatype, as I later attempted).
      
      I can get it to *work* by changing all the parameters in the stored 
      procedure to varchar and then doing some casts or converts before performing 
      the insert or update into the tables.  But this just does not feel like the 
      right way to do it.
      
      Can anyone help me figure out why the SQL Adapter will not pass parameters 
      other than nvarchar?
    • #17554

      Try xs:decimal for money type

      xs:String for Date in schema, and datetime rather than smalldatetime in procedure

      • #17559

        I have tried updating the date types in the xsd.  But I still get the error back from the SQL Adapter "cannot convert type 'nvarchar' to money" or whatever the data type I am trying to conver to.  When I look at what is happening using the SQL Profiler, all stored procedure parameters are sent as nvarchar.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.