I am at a "dead end" with my powershell script. It executes correctly but it takes to long to execute. (about 7days since it does millions of DML operations on a SQL Server Database).
Can anyone point me on where i can start looking to solve this?
The first thing to determine if the time is taken up by the PowerShell script itself or if the script is waiting for the SQL commands to complete. Is the SQL server/database the bottleneck.
It may also be the type of SQL command used, INSERT vs BULK INSERT
It's probably not possible to give you specific advice without the code, and for a 600-line script, it's going to be difficult for a volunteer to find that kind of time ;).
Do you think that it's mainly the SQL portion that's causing the long time? If so, that's really a query optimization or SQL Server optimization problem, and this isn't probably the right place to find answers for that. It could be anything from a poorly designed schema, to badly designed indexes, to indexes needing maintenance, to a thousand other things.
You must be logged in to reply to this topic.