Sorry to hear you’re having issues with your SQL scripts! The first thing I would check here is to ensure that the deployment target you are using has access to your SQL server, in most cases, the machine may not have access due to network security devices blocking access.
Since you’re doing the updates with PowerShell, I recommend logging onto the deployment target as the user that is running the tentacle service on that machine and see if you can run them outside Octopus itself. If network security does allow the connection, running this manually might give you some more context as to why it is failing.
If you would like to give this a try, and if you’re still having trouble, please let us know and we’ll help you dig in further!