KB4010159 - FIX: "Invoke-sqlcmd" cmdlet executes a query statement multiple times if an error occurs in SQL Server 2014 or 2016

Symptoms

You use the invoke-sqlcmd cmdlet to execute a query statement in an instance of SQL Server 2014 or 2016. However, if execution fails because of an error, the query statement is executed multiple times.

Resolution

This issue is fixed in the following cumulative updates for SQL Server:

Cumulative Update 5 for SQL Server 2016 RTM  

Cumulative Update 2 for SQL Server 2016 SP1

Cumulative Update 4 for SQL Server 2014 Service Pack 2

 

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

 Latest cumulative update for SQL Server 2016

 Latest cumulative update for SQL Server 2014

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

 

References

Learn about the terminology that Microsoft uses to describe software updates.

 

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×