A SQLPS (SQL PowerShell) module commandlet added for Microsoft's SQL Server 2012 that allows for scripting a SQL database backup.
Questions tagged [backup-sqldatabase]
19 questions
11
votes
2 answers
Use Backup-SqlDatabase cmdlet with SQL Server Authentication
Is there a way to call Backup-SqlDatabase cmdlet but have it connect to SQL Server 2012 with SQL Server credentials?
The command I am currently using is:
Backup-SqlDatabase -ServerInstance $serverName -Database $sqldbname -BackupFile…

Maxim V. Pavlov
- 10,303
- 17
- 74
- 174
4
votes
1 answer
Powershell: Backup-Sqldatabase fails to resolve path
EDIT:
I figured out that I needed to specify the ServerInstance as well:
Backup-SqlDatabase -ServerInstance [ServerName] -Database [DBName] -BackupFile "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\Copy.bak"
ORIGINAL…

Rasmus
- 55
- 1
- 7
2
votes
3 answers
Backup-SqlDatabase is not recognized
I have a PowerShell script to backup a database. But today it has stoped working with next error:
Backup-SqlDatabase : The term 'Backup-SqlDatabase' is not recognized as
the name of a cmdlet, function, script file,
or operable program. Check the…

Oleg Oshkoderov
- 500
- 1
- 4
- 17
1
vote
0 answers
Backup-SqlDatabase with specific Windows Authentifiation
I try to use the powershell command Backup-SqlDatabase with a specific windows authentication (not the current)
Backup-SqlDatabase -ServerInstance $instanceName -Database $databaseName -BackupAction Database -Credential $credential -BackupFile…

Batbaille
- 61
- 1
- 5
1
vote
1 answer
How to backup (automatically) an azure sql database on a local server?
I am looking for a way to backup an azure sql database to a local server. The backup should be created automatically.
How can I do that?
Thanks in advance!

julius
- 81
- 1
- 8
1
vote
1 answer
Backup-SqlDatabase PsDrive Filesystem
I'm trying to backup a SQL database to a remote location, with the Backup-SqlDatabase cmdlet, to a PSDrive (filesystem) with no success.
I am creating a PSDrive for example \\server\sharedFolder with a name TARGET.
New-PSDrive –Name TARGET…

Nuno
- 126
- 2
- 14
0
votes
0 answers
How to download or save SQL Server database full backup and restore it using ASP.NET Core with a LINQ query?
I have developed an ASP.NET Core web application, I need to write a C# method to allow the end user to download or save the SQL Server database full backup on his local computer. Moreover, I need to upload that database backup to restore a…

Hedayat Hoshmand
- 39
- 2
- 12
0
votes
0 answers
Restore database from .bak file gives error at copy
I have a .bak file (74GB) containing all my database webapp from Postgres 12.1 generated via the following .bash cronjob:
#!/bin/bash
backupfolder=”/home/backups/database/postgresql"
day=$(date+%Y%m%d)
su postgres −c ”pg_dump webapp >…

CarlosCarraPer
- 1
- 2
0
votes
2 answers
How to lock Data Base when pg_restore runs
When running pg_restore we encounter some (unexpected) executions from some other programs resulting in errors in the restoration.
Is there a way to lock the DB while restoring to insure no modifications are done ?
This is the command executed…

Mohamed BOUAKKAZ
- 45
- 2
- 10
0
votes
0 answers
Backup SQLServer from Powershell (for Linux)
I have a problem setting the BackupFile-attribute on the Backup-SqlDatabase command (in Powershell for Linux). It expects a Windows path.
What I did:
I've installed PowerShell on a centos Linux. I started Powershell with pwsh and installed the…

SanSaurus
- 63
- 4
0
votes
1 answer
Storing radio button values in database
I have a form with:
textbox roomnumber (table column number int)
combobox roomtype (table column type varchar)
textbox phone (table column phone varchar)
radiobuttons yes or no (table column free varchar)
I have a…

LMS
- 19
- 4
0
votes
1 answer
Automate SQL Server database schema only Backups
I need to backup SQL Server schema of all databases on a daily basis. This way I don't have to restore the whole 700GB database for a single table structure.
Any help is appreciated.
Thanks

Krishna Chaitanya
- 65
- 8
0
votes
1 answer
How to get backup path details once backup is completed using backup-sqldatabase in powershell
I am trying to take SQL DB backup from PowerShell using backup-sqldatabase module using the below script. The module works fine with taking DB backup however I am unable to figure out the backup file name for further use.
I have executed the below…

SQLDoctor
- 343
- 7
- 16
0
votes
1 answer
C# Win Form - Allow to save file only on LOCAL PC
Brief
I am trying to backup SQL Database through my software. At runtime the software asks the user where does he want the backup to be stored.
Requirement
Now, my requirement is that the user can only create backup on the PC itself or on any…

Agent_Spock
- 1,107
- 2
- 16
- 44
0
votes
0 answers
Prompt command run in CMD but not when executed by process (Sql Server backup with CMD)
I was trying to make a simple backup application to do some tasks like
Rar folder to destination
backup database files
copy some files from another machine
I can do all those things in CMD, so I made an EXE that simple executes those commands in…

P. Waksman
- 979
- 7
- 21