I have a PowerShell script which does complicated queries to sccm on a daily basis.
I d like to create a scheduled job which puts the output in a Microsoft Sql database.
I can create the initial database and fill.it up with data but how to update it correctly via sql?
So that would be $sccmdata | foreach item
If not exist delete, if exist update if not exist create
Please help with the sql query and ps script