Does anyone know the powershell commands to restore a remote database from a local file?
A:
What kind of database? What kind of local file? Is it a backup file (like from SQL Server), or a SQL language script (something like MySQL can produce)?
Don Jones
2008-12-18 21:16:32
sql server 2008. sql server backup file.
mson
2008-12-19 00:35:58
+1
A:
Based on your comment, there are no PowerShell-specific commands. You'll need to use New-PSDrive to map a drive to the server, use Copy-Item to copy the database over to the server, and then use one of the SQL 2008 commands (there are 2 total) to execute the necessary RESTORE DATABASE command. SQL2008 hasn't shipped anything more specific than that, and the SQL Server product itself can't perform a restore from a remote path (well, maybe a UNC, but I assume you're on a client - it'd be easier to copy the backup to the server).
Don Jones
2008-12-19 01:05:50