Cannot script stored procedure while restoring another copy of current db
1
vote
1
answer
316
views
I have some large DB that I need to restore to another db from time to time, this process take some time to conclude. The annoying thing I found out in last version of SSMS is that I cannot script any sp of the current db while I do this restore.
In my case I have the current db named
I have no need to open the database
> Microsoft SQL Server 2019 (RTM-CU10) (KB5001090) - 15.0.4123.1 (X64)
> Mar 22 2021 18:10:24 Copyright (C) 2019 Microsoft Corporation
> Standard Edition (64-bit) on Windows Server 2016 Datacenter 10.0
> (Build 14393: ) (Hypervisor)
- SQL Server Management Studio 15.0.18390.0
- SQL Server Management Objects (SMO) 16.100.46521.71
- Microsoft Analysis Services Client Tools 15.0.19714.0
- Microsoft Data Access Components(MDAC) 10.0.19041.1
- Microsoft MSXML 3.0 6.0
- Microsoft .NET Framework 4.0.30319.42000
- Operating System 10.0.19043
I do not use SSMS to do the restore, I use my own script. There are two backups to restore, full + diff. I do full with norecovery and diff with recovery.
FleetXS
that is online and is in use and I do the restore of backup of this db with the date of 2 days ago in other db named Fleetxs_Restore
. For all the time of the restore it's not possible to script any sp of db FleetXS
with the weird error
> Cannot open database "FLEETXS_restore" requested by the login. The
> login failed. Login failed for user 'anna'. (Microsoft SQL Server,
> Error: 4060)

FLEETXS_restore
that even is not actual to date, I operate within my current database FleetXS
that is online, why on the earth my login "requested db FLEETXS_restore
"? Is there any workaround or should I wait for hours when the restore finishes to be able to get the text of sp of **another** database?

Asked by sepupic
(11277 rep)
Nov 5, 2021, 10:43 AM
Last activity: Apr 28, 2025, 09:03 PM
Last activity: Apr 28, 2025, 09:03 PM