FRENDS⁴ Common Components : ~SQL.InsertData (removed in version 2.0.1.1)

This task has been removed from NuGet package version 2.0.1.1 onwards. Use SQL.BulkInsertData instead.

 

This task takes a JSON document or an XML document and inserts the data in that document to the designated table. The input document element names must match the table column names. Columns with default values can be left as null or empty in the source document.

Input Parameters

  • Input
    • The XML or JSON document that contains the data to be inserted.
      • The input must be inside a single root element if the input is XML
      • The input must be a JSON array if the input is JSON
      • Supported input types are:
        • String JSON
        • String XML
        • C# Dataset
        • C# XmlDocument
        • C# JObject
  • InsertTableName
    • Name of the table the data is to be inserted into.
  • ConnectionString
    • The connection string of the database the query is executed to.
  • TimeoutS
    • The timeout of the stored procedure execution in seconds.

Output Result

  • Boolean
    • True if the insert was successfull

Example Usage

Input

<InsertList>
  <dbo.CDInformation>
    <Title>Empire Burlesque</Title>
    <Artist>Bob Dylan</Artist>
    <Country>USA</Country>
    <Company>Columbia</Company>
    <Price>10.90</Price>
    <Year>1985</Year>
  </dbo.CDInformation>
</InsertList>

InsertTableName dbo.CDInformation

The above input will be inserted to the CDInformation table.

Errors

The task will return an exception The input data was not recognized. Supported formats are String, XMLDocument, JObject and DataSet. if the input data or the XSLT document could not be read correctly.