Tag Info

New answers tagged

1

Replace 'drop database [myDb_snapshot]' with: declare @cmd nvarchar(max); set @cmd = 'drop database [myDb_snapshot]'; exec (@cmd); The entire SQL statement is evaluated for correctness prior to running it. Since the snapshot doesn't exist, it won't run. Dynamic SQL removes that limitation.



Top 50 recent answers are included