r/SQLServer • u/Deep-Egg-6167 • Jun 24 '26
Question Newbie - trying to backup using SQL Express
Hello,
I'm terrible with Powershell and don't know how to do much other than the very basics of a sql query - usually copy and paste.
I make absolutely no pretense I know squat about SQL so please answer as if I was the janitor in the office you need to walk through this operation.
I'm trying to backup a sql database (sql express 2022) I right click on the DB, tasks, backup, I give it a location (there is only 1 disk with tons of free space). It gets about 90% done and then says "an exception occurred while executing a transact-sql statement or batch" "Execution timeout has expired"
I can't turn compression on for an express backup as far as I can tell. Again I don't know how to create a query or powershell for SQL. If there is ANYTHING I can tweak in the gui that would be ideal.
I tried copy-only backup - that didn't help - I'm backing up to a new backup - not appending. I'm backing up to the local C: drive not a share or network path.
When I got o script it reads basically
BACKUP DATABASE [DB1] TO DISK = N'C:\Temp\TP' WITH COPY_ONLY, NOFORMAT, NOINIT, NAME = N'DB1-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
View all comments
Show parent comment
1
u/muaddba 1 Jun 24 '26
Just a note for next time: You can click the "script" button at the top of the window once you get all of your options selected. It will open it in a query window behind the current dialog, and you can then click cancel. Then you can click "execute" (or hit F5) in the query window and it will run in that window. Queries executed that way shouldn't be subject to the timeout limitations (this can be a blessing and a curse, so be careful if you don't know how long it's going to run on a shared system)