New answers tagged

7

When accessing UNC paths, or any 'location' that isn't a local drive (i.e. registry), from a PowerShell job step, you need prefix the path with Microsoft.PowerShell.Core\FileSystem::. This tells SQLPS which provider to use, which isn't required in normal PowerShell but is required in the SQL Server implementation. Alternatively, you can change directory ...


-2

sqlcheckpoint, Please take a look at the link below, which describes which Powershell modules are used by SQL Agent. Its either SQLPS or SqlServer depending upon your version of SQL Server. https://docs.microsoft.com/en-us/sql/powershell/run-windows-powershell-steps-in-sql-server-agent?view=sql-server-ver15 It quite likely the New-Item cmdlet is not found ...


0

If not impacting business, have you tried to kill the connection app-side? We had an issue with locked/active sessions from an app to a MSSQL DB, however the only way we could bypass was to break the active connection from the app to the DB via failover. That was only because it shifted resources from node 1 to node 2. We attempted to kill the connection ...


0

Good research! I had (have!) trouble deleting replicate Articles with SQLserver 2012 (11.0.3000.0) after a server rename. That in turn does not allow me some table operations, notably truncate. fwiw, Hein.


Top 50 recent answers are included