One of the value contains single quotation thats why its breaking the sql insert command. So it was replaced & then executed.
Unclosed quotation mark after the character string.
D Mallikarjuna Reddy
96
Reputation points
I am using Azure Automation Runbooks to insert some data into Azure SQL.
We have 17k lines of data and this below query is being failed for only 3 rows. Not sure what's wrong here.
Azure SQL Database
Azure SQL Database
An Azure relational database service.
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
2 answers
Sort by: Most helpful
-
-
AnuragSingh-MSFT 21,566 Reputation points Moderator
2023-07-12T07:27:25.4233333+00:00 @D Mallikarjuna Reddy , thank you for sharing the solution with the community.
You may also consider using the
-variableparameter withInvoke-Sqlcmdso that the query string does not terminate unexpectedly when delimiters like ";" or singlequotes are there in the values to be inserted. For details, see -variable in Invoke-Sqlcmd