We help IT Professionals succeed at work.

Powershell v3 - SQLCMD

sj77
sj77 asked
on
134 Views
Last Modified: 2018-03-07
I need to build a PS script that will call upon the MSSQL db and pass through a t-sql query to backup a database, then, restore the backup into another DB on the same server.

Thanks!
Comment
Watch Question

IT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
I just recently started getting into powershell, and, I love the power it brings to the table. So I was curious to a backup example in powershell for SQL DB.
Vitor MontalvãoIT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Ok but for SQL Server whenever you can, use proprietary scripts.
Check the link I've posted in my last comment to see if it helps you.