New answers tagged

2

According to the documentation for Invoke-Sqlcmd, you can use -verbose to display the output messages. From that post: Example 5: Run a query and display verbose output PS C:\> Set-Location "SQLSERVER:\SQL\MyComputer\MainInstance" PS C:\> Invoke-SqlCmd -Query "PRINT N'abc'" -Verbose VERBOSE: abc I have bat file processes that use ...


0

Sorted it. Mapped the network share to the workspace of the SQL server using the code below sp_configure 'show advanced options', '1' RECONFIGURE sp_configure 'xp_cmdshell', '1' RECONFIGURE set @cmd='net use P: \\XXX.XXZ.XYZ.010\backup\ Password /user:XXX.XXZ.XYZ.010\NASAccount'; exec master..xp_cmdshell @cmd, no_output; Then you should be able to backup ...


1

the problem are not coming from the dba tools but from your network. You can't mount a share on a local path. That path (K) can't be seen by sql server. The unc path works with the user that is running the sql server service, in your case the computer account; but you can't authorise the compunter account in your nas under workgroup. The only option i can ...


0

Create an agent job that runs on start up to set the number of threads. Set the schedule option to Start Automatically when SQL server agent starts.


0

For the First question, I agree with the above post of @Kin Shah. For the second question, which means if we want to log the verbose message into a log file and PowerShell window, both the places then we can use tee-object like below: invoke-sqlcmd -Query "PRINT 'Hello World'" -ServerInstance WL357044\SQL2017 -Database abc -Verbose *>&1| tee-...


0

For 1, you can use PowerShell redirection operators. As per Redirectable output streams, steam 4 is Verbose Stream which is what you want. invoke-sqlcmd .... -verbose 4>> "D:\temp\yourlogfile.log" Above will append all your invoke-sqlcmd into just one log file "D:\temp\yourlogfile.log" your question part 2 is unclear to me.


1

Plase try to collect from msdb database the latest backup with a query like that: SELECT A.[Server], A.last_db_backup_date, B.backup_start_date, B.expiration_date, B.backup_size, B.logical_device_name, B.physical_device_name, B.backupset_name, B.description FROM ( SELECT CONVERT(CHAR(100), ...


Top 50 recent answers are included